• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/14

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

14 Cards in this Set

  • Front
  • Back

What is the difference between parallelism and concurrency?

Parallelism means the system can perform more than one task simultaneously while concurrency means there can be more than one active task making progress.

What are the two types of parallelism?

Data Parallelism - distributing data across multiple stores.




Task Parallelism - distributing tasks across multiple processors

True or False: Each new thread shares only its Heap, Data and Text areas of memory with the other threads in the same process

True. Threads have the same code and global memory as other threads in the same process, but they each have their own separate Registers and Stack.

What does Amdahl's Law tell us?

The speedup you can reach by adding more cores to your computer (taking into account what percentage of the program is serial and no-serial)

What are the advantages of the many-to-many threading model (between user threads and kernel threads)?

Many-to-one threads allow the user to create as many threads as he wants, but doesn't take of advantage of true concurrency. One-to-One takes advantage of true concurrency but programmer must make sure not to create more user threads than kernel can handle.




Many-to-many thread model allows real concurrency and also takes care of programmers who make too many threads (simply adds to Kernel threads when max is reached)

What are Pthreads?

A specification (not an implementation) for POSIX thread APIs, common in UNIX systems

What are thread pools?

Pre-made threads that are ready to accept new tasks, requests, etc. Having them ready in a pool is more efficient than creating them as they are needed especially if many requests in quick succession are expected.

What does #pragma omp parallel mean in OpenMP?

It essentially tells the compiler to create as many threads as there are cores and run the code in the following block

What is Grand Central Dispatch?

An Apple technology, API, etc extending C languages providing syntax and mechanism to run concurrent threads from a dispatch queue.

Some UNIX-based OSs have another function similar to fork(). What is it and what is the difference with fork().

clone(), which creates a new thread (not process) in the same process space. fork() creates a new process containing one thread.

Linux has about 30 standard signals. How is Signal 2 called?

By pressing CTRL+C to interrupt a process

What are the two general approaches to Thread Cancellation?

1) Asynchronous Cancellation : cancel the thread outright immediately


2) Deferred Cancellation: the thread checks periodically if it should be cancelled

In Pthreads, what is Thread Local Storage?

A mechanism that allows threads to have their own storage space - similar to static variables in C.

What flags can be passed to clone() in Linux, when creating a new thread?