Introduction to Threads and Concurrency
- Concurrent vs. parallel
- Scheduling
- Synchronization
- Virtual adress space organization
- Overview of how a function-call is performed and why it's relevant to threads
POSIX Threads
- Overview of the POSIX Threads C API
- Creating a thread
- Passing paramaters to a new thread
- Configuring threads, like setting the stack-size
- Implementing class Thread
The Critical Section Problem
- Understanding the problem and its solution
- Three conditions for the critical-section problem
- POSIX mutex variables
- Configuration
- Handling timeouts
- Avoiding self-deadlock
- Implementing class Mutex
- Implementing class Guard
The Race-Condition Problem
- Understanding the problem and its solution
- POSIX condition variables
- Configuration
- Handling timeouts
- Understanding monitor semantics
- The minimum amount of code to safely transfer data from one thread to another
- Implementing class Condition
- Implementing class MailBox
The Deadlock Problem
- The concept resource
- Understanding the problem and its solution
- Four conditions for the deadlock problem
- Preventing deadlocks
- Detection of deadlocks
Synchronization and Other Data-Types
- Read/Write locks
- Barriers
- Thread-local storage
- Implementing classes for read/write locks
- Implementing class Barrier
- Implementing class ThreadLocalStorage
Semaphores
- POSIX semaphores
- Memory-based vs. file-based semaphores
- Implementing class Semaphore
- Implementing class FileSemaphore
Uni-directional Message Passing
- What is message-passing
- Handling pointer based messages
- Understanding the message-queue concept and its synchronization requirements
- Implementing class MessageQueue
- Implementing class MessageThread
- Implementing interface Receivable
- Implementing a threads pipeline
Bi-directional Message Passing
- N clients & 1 server
- 1 client & N servers
- Understanding Extended Rendezvous
- Implementation of Extended Rendezvous
- Understanding Futures
- Implementation of Futures
Shared Memory
- What is shared memory
- Understanding the mmap() system call
- The POSIX Shared Memory API
- Implementing class SharedMemory
Threads & Processes
- Creating processes
- Waiting for process termination
- Adapting mutexes and conditions for shared memory
- Implementation of a message-queue in shared memory
- Implementation of a threads pipeline between processes and via shared memory
A quick C++11/14/17 Primer
- Highlights of the new standard relevant for the following chapters
Threads in C++11
- Overview of the threads support first introduced in C++11
- Using class thread
- Usage of lambda expressions when defining threads
C++11 Synchronization
- Using class mutex
- Using class condition_variable
- Usage of lock guards
- Usage of multi-locking and avoidance of deadlocks
- Implementation of class MessageQueue<T> using C++11
C++ Futures
- Understanding C++11 promises & futures
- Implementing Extended Rendezvous using C++11 futures
- Spawning asynchronous tasks