Mapa mental
CHAPTER 4: THREAD AND CONCURRENCY
Conteúdo do mapa
CHAPTER 4: THREAD AND CONCURRENCY
Multi-threading Models
- Many to one
- One thread blocking cause all to block
- Many user level mapped to a single kernel thread
- One to one
- Each user-level maps to kernel thread
- Create User-Level Thread=Create Kernel
- Number of threads per process sometimes restricted due to overhead
- Many to many
- Many user-level mapped to many kernel
- Allows OS to create sufficient number of kernel threads
- Many to one
Multicore Programming
- Challenges
- Dividing activities
- Balance
- Data splitting
- Data dependency
- Testing and debugging
- Parallelism
- Implies that a system can perform more than one task simultaneously
- Type of Parallelism
- Task Parallelism
- Distributing threads across cores, each thread performing unique operation
- Data Parallelism
- Distribution subsets of the same data across multiple core, same operation on each
- Task Parallelism
- Concurrency
- Supports more than one task making progress (single processor/core, scheduler providing concurrency
- Challenges
Benefits
- Responsiveness
- Scalability
- Resource sharing
- Economy
Threading issues
- Semantics of forks() and exec() system calls
- Signal Handling (synchronous & asynchronous)
- Signals are used in UNIX to notify a process that a particular event has occurred
- Every signal has default handler that kernel runs when handling signal
- Single handler is used to process signals. Generated by particular event, delivered to a process, handled by one of two signal handler (default, user-defined)
- Thread Cancellation
- Terminating threads before it has finished
- Target thread = Thread to be cancelled
- 2 general approaches
- Asynchronous Cancellation
- Deferred Cancellation
- Thread-Local Storage
- Allows each thread to have copy of its data
- Different from local variable, but similar to static data
- Scheduler Activation
- Many-to-Many and 2-level models require communication to maintain the appropriate number of kernel threads allocated to the application
- Typically uses lightweight process
- Appears to be virtual processor on which process can schedule user thread to run
Informações
- Descrição
- Mapa Mental sobre CHAPTER 4: THREAD AND CONCURRENCY, criado por Nyxx Ulric em 15-10-2018.
- Criado por
- Nyxx Ulric
- Visualizações
- 0
- Avaliação