Linux Multithread-/Multicore-Programming
Who should attend:
Software developers, software architects
Pre-requisites:
Knowledge of the programming language C
Duration:
3 days
Course Description:
This course shows how the processor performance of Linux systems can optimally be used, especially in modern multicore architectures. It has been developed for software developers having to develop new applications or having to optimise existing ones and is also suitable for Embedded Linux software development. The special focus of this course is the presentation of the Pthread-API of the NPTL library (Native Posix Threads Library). The training covers the range of functions of the thread library in detail and also shows problems and solutions as well as guide lines for a good multithread software design. Additionally the course also gives an introduction into the software development with OpenMP and thus provides an insight in an entirely different kind of software development for multithreading systems.
Course outline:
Introduction to multithreading
- Functional principle
- Threads vs. Processes
- The Posix Standard and the Pthread API
- The NPTL-Thread-Model
- Scheduling concepts
- Thread states
Threads
- Thread creation
- Passing parameters and return values
- Thread attributes
- Priorities and scheduling
- Time sharing
- Real time
- Threads and Signals
- Thread local Storage
- Thread cancellation
Synchronisation
- Flag synchronisation
- Race conditions
- Mutexes
- Recursive access
- Deadlocks
- Priority inversion
- Ceiling priority
- Fairness
- Reader-/Writer-Locks
- Semaphores
- Condition variables
- Barriers
- Onetime initialisation
Multicore Programming
- When is multicore useful?
- Amdahl’s Law
- Approaches for performance optimisations
- False Sharing
- Processor affinity
- Spinlocks
- Guide lines for a good application design
Outlook
- What is OpenMP?
- Example: Multithread programming without (explicit) threads