Threads & Concurrency

Get Started. It's Free
or sign up with your email address
Threads & Concurrency by Mind Map: Threads &   Concurrency

1. Implicit Threading

1.1. Growing in popularity as numbers of threads increase, program correctness more difficult with explicit threads

1.2. Creation and management of threads done by compilers and run-time libraries rather than programmers

1.2.1. OpenMP

1.3. Five methods explored

1.3.1. Fork-Join

1.3.2. Thread Pools

2. System Calls

2.1. provide interface between a running program and the OS.

2.2. types of system calls

2.2.1. file management

2.2.2. deivce management

2.2.3. information maintenance

2.2.4. communications

3. Motivation

3.1. Multiple tasks with the application can be implemented by separate threads

3.1.1. Update display

3.1.2. Fetch data

3.1.3. Spell checking

3.1.4. Answer a network request

3.2. Can simplify code, increase efficiency

3.3. Kernels are generally multithreaded

3.4. Most modern applications are multithreaded

4. Benefits

4.1. Scalability – process can take advantage of multicore architectures

4.2. Responsiveness – may allow continued execution if part of process is blocked, especially important for user interfaces

4.3. Resource Sharing – threads share resources of process, easier than shared memory or message passing

4.4. Economy – cheaper than process creation, thread switching lower overhead than context switching

5. Multicore Programming

5.1. Concurrency supports more than one task making progress

5.2. Parallelism implies a system can perform more than one task simultaneously

5.2.1. device drivers

5.2.2. file systems

5.2.3. virtual memory manager

5.2.4. windowing system

5.2.5. security services

5.3. Multicore or multiprocessor systems putting pressure on programmers, challenges include:

5.3.1. Dividing activities

5.3.2. Balance

5.3.3. Data splitting

5.3.4. Data dependency

6. Scheduler Activations

7. Both M:M and Two-level models require communication to maintain the appropriate number of kernel threads allocated to the application

8. Scheduler activations provide upcalls - a communication mechanism from the kernel to the upcall handler in the thread library

9. This communication allows an application to maintain the correct number kernel threads

10. Multithreading Models

11. Many-to-One

12. One-to-One

13. Many-to-Many

14. User Threads and Kernel Threads

15. User threads - management done by user- level threads library

16. Three primary thread libraries

17. Kernel threads - Supported by the Kernel