Quiz 2 Flashcards
What tasks can be implemented using threads?
Updating the display, fetching data, spell checking, answering a network request.
What is duplicated when a new thread is created?
Registers, stack and PC
What is shared among different threads?
Code, Data, files
What are some of the benefits of thread creation?
Responsiveness
Resource Sharing
Economy
Scalability
What are some challenges with multicore programming?
Dividing activities, Balance, Data Splitting, Data Dependency, Testing and debugging
What does parallelism imply?
That a system can perform more than one task simultaneously.
What does concurrency support?
More than one task making progress.
What are the two types of parallelism?
Data parallelism and Task parallelism
What is data parallelism?
When subsets of the same data is distributed among multiple cores.
What is task parallelism?
When multiple threads are disputed across cores.
What is Amdahl’s Law?
The fact that performance gains from adding additional cores to an application approaches 1 / S where S is the portion that can be serial
What are User threads?
Management done by user-level threads.
What are the three primary thread libraries?
POSIX Pthreads, Windows Threads, Java threads
What are Kernel threads?
Threads created and supported by the kernel
What are the three Multithreading Models?
Many-to-One
One-to-One
Many-to-Many
What is Many-to-One?
When many user level threads are mapped to single kernel threads.
What are some issues with Many-to-One?
If one thread blocks all threads are blocked.
Multiple Threads may not run in parallel on multicore systems as only one may be in the kernel at a time.
What is One-to-One?
When each user-level thread maps to the kernel thread.
What is the Many-To-Many model?
When many user level threads can be mapped to many kernel threads.
What is the Two-level Model?
Similar to the Many to Many model except that a user thread can be bounded to a kernel thread.
What is a thread library?
A thread library provides a programmer with an API for creating and managing threads.
What are the 4 methods explored in reference to Implicit Threading?
Thread Pools
Fork-Join
OpenMP
Grand Central Dispatch
What are Thread Pools?
Thread Pools are when the system creates a number of threads in a pool where they wait to work on processes.