it allows a program to operate more efficiently by doing multiple things at the same time.
Threads
1/37
| Term | Definition |
|---|---|
it allows a program to operate more efficiently by doing multiple things at the same time.
| Threads |
this creation is heavy-weight | Process creation |
run within application
| Threads |
this creation is lightweight | Thread creation |
puts pressure on programmers | Multicore or multiprocessor systems |
it implies a system can perform more than one task simultaneously | Parallelism |
supports more than one task making progress
| Concurrency |
it distributes subsets of the same data across multiple cores, same operation on each | Data parallelism |
it is distributing threads across cores, each thread performing unique operation | Task parallelism |
is a formula that specifies the potential speedup in latency of task execution at a specific workload | Amdahl’s Law |
Many user-level threads mapped to single kernel thread | Many-to-One Model |
Each user-level thread maps to kernel thread
| One-to-One Model |
Allows many user level threads to be mapped to many kernel threads
| Many-to-Many Model |
Similar to M:M, except that it allows a user thread to be bound to kernel thread
| Two-level Model |
it refers to the approach where the management of threads is abstracted away from the programmer.
| Implicit threading |
used to manage a pool of pre-created threads waiting for tasks to execute.
| Thread Pools |
Multiple threads (tasks) are forked and then joined.
| Fork-Join Parallelism |
Creation and management of threads done by compilers and run-time libraries rather than programmers
| Implicit threading |
also known as libdispatch, is a technology developed by Apple to optimize application support for systems with multi-core processors. It essentially simplifies writing code for iOS and macOS
| Grand Central Dispatch (GCD) |
is an open-source C++ template library developed by Intel for parallel programming on multi-core processors.
Focus on tasks, not threads
| Intel Threading Building Blocks (TBB) |
makes it easy to write programs that run on multiple CPU cores simultaneously — using threads — without writing all the thread management and synchronization manually.
| OpenMP |
Terminating a thread before it has finished
| Thread Cancellation |
It is an application programming interface (API) that supports multi-platform shared-memory multiprocessing programming in C, C++, and Fortran | Open MultiProcessing (OpenMP) |
Thread to be cancelled is | Target thread |
one approach of thread cancellation that allows the target thread to periodically check if it should be cancelled | Deferred cancellation |
primary API for Windows applications
| Windows API |
one approach of thread cancellation that terminates the target thread immediately
| Asynchronous cancellation |
primary data structures of a thread include:
| ETHREAD, KTHREAD, TEB |
Implements the one-to-one mapping
| Windows Threads |
thread id, user-mode stack, thread-local storage, in user space | TEB (thread environment block) |
Linux refers to them as tasks rather than threads | Linux Threads |
is the kernel mode representation of a thread within the Windows kernel. | KTHREAD (kernel thread block) |
context of the thread | register set, stacks, and private storage area are known as the |
is the user mode representation of a thread within a Windows process. | ETHREAD (executive thread block) |
creation of this is done through clone() system call
| Thread creation |
split/divide tasks | Fork Parallelism |
join all tasks | Join Paralellism |