Thank you for sending your enquiry! One of our team members will contact you shortly.
Thank you for sending your booking! One of our team members will contact you shortly.
Duration 28 hours
Course Outline
Challenges and Concurrency Problems
- Hardware limitations of platforms - hardware threads, pipelines, cache coherence
- Fundamental concepts related to multithreaded programming (correctness of multithreaded programs, liveness, deadlock, livelock, race conditions, atomicity, memory models, Flynn's taxonomy)
- Available mechanisms in C++ for implementing multithreading and multiprocessing
- Standard library implementation - features from C++14 to today (C++2a)
- Implementation available in Boost - differences compared to the standard library
Processes and Threads
- Multiprocess vs multithreaded applications
- Operating system and threads (short overview of available implementations)
- Process and thread synchronization mechanisms
- Structural implementation of synchronization
- Specifics of multithreading implementation in an object-oriented approach (role of RAII pattern)
Memory Model in C++
- Objects and memory locations
- Ordering operations and enforcing them
- Relations: synchronization, precedence, ordering of operations for atomic actions, release sequences
- Memory barriers
- Atomic operations
Thread Management in C++14 and Newer
- std::thread class and running threads
- Thread identification
- Attaching and detaching threads
- Threads and standard containers
- Exception handling in C++14 threads
Mutual Exclusion and Critical Sections
- Simple mutual exclusion principles
- Concepts (types) of available blocking objects
- Quick introduction to time handling in C++14 (chrono library)
- std::mutex, std::timed_mutex, std::shared_mutex classes and derivatives
- RAII pattern in lock handling (std::lock_guard, std::unique_lock)
- Dependent and deferred locks (std::lock)
- Ownership and co-ownership of locks and threads
- Readers-writers problem
- One-time initialization
- Thread-local (private) memory (std::thread_local)
Locks and Thread Synchronization
- Semaphore operations
- Recursive locks
- Locks with defined locking levels
- Decision variables and cooperation with locks
- Implementation of active and passive barriers (Idle Waits, Busy Waits)
- Resuming thread execution
- Communication between threads (Actor model and CSP)
Asynchronous Tasks
- Asynchronous events and their handling
- Futures
- Promises
- Packaged tasks
Atomic Types
- Standard atomic types
- Universal atomic flag (std::atomic_flag)
- Template class "std::atomic[T]" and its specializations
- Helper functions (free functions) of std::atomic types
Specifics of Multithreaded API Design
- Designing structures using locks - coarse-grained and fine-grained locks
- Concurrency code efficiency - estimation and measurement techniques
- Data partitioning
- Scalability of solutions
- Error handling and exceptional situations in application architecture
Testing and Debugging Multithreaded Applications
- Code reviews for multithreaded operations
- Specifics of testing multithreaded applications
- Unit tests
- Increasing the probability of emergency situations for testing
- Formal methods for testing multithreaded applications
- Architectural patterns of multithreaded applications and testing and debugging (overview)
Advanced Thread Management
- Dependent threads (Saga pattern)
- Avoiding data access contention
- Controlled stopping and interrupting threads
- Interrupting blocking calls
- Interrupt handling
- Work stealing
- Interrupting tasks during application shutdown
Multithreading Design Patterns
- Types and purposes of multithreading patterns
- Pattern application scope
- Thread Pool
- Active Object pattern
- Thread-Safe Queue
- Producer-Consumer pattern
- Monitor pattern
- Multithreading safety of GoF patterns
Requirements
- Ability to use software building tools in C++ in GNU/Linux and/or MS Windows environments
- Knowledge of C++ programming issues (procedural and object-oriented paradigms) at an advanced and intermediate level
- Knowledge of code generation issues (templates)
Testimonials (1)
Practical examples