Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 4: Threads (Overview (Benefits (Responsiveness, Resource sharing,…
Chapter 4: Threads
Multi-threading models
Many-to-One
-
-
Multiple threads may not run in parallel on multi-core system because only one may be in kernel at a time
-
-
-
-
Threading Issues
-
-
-
-
Scheduler Activation
Provide up calls which is a communication to maintain the appropriate number of kernel threads allocated to the application
Overview
-
Definition
A basic unit of CPU utilization which comprises a thread ID, a program counter, a register set and a stack.
-
Multi-core Programming
Parallelism
-
Types
Data
Distribute subsets of the same data across multiple cores, same operation on each
Task
Distributing threads across cores, each thread performing unique operation.
-
Amdahl's Law
Identifies performance gains from adding additional cores to an application that has both serial and parallel components
-
Thread Libraries
-
-
-
-
Implicit Threading
Method
Thread pools
-
Pros
-
-
Separating task to be performed from mechanics of creating task allows different strategies for running task
OpenMP
Set of compiler directives and an API for C, C++, Fortran
-
-
Grand Central Dispatch
Type of dispatch queues
Serial
Blocks removed in FIFO order, queue is per process called main queue
-
-
OS Examples
Windows Threads
Implements windows API, One-to-One mapping, kernel level
Data structure
-
KTHREAD
-
Scheduling and sync info, kernel-mode stack
TEB
-
Thread id, user-mode stack
-