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 problems of concurrency
- Platform hardware limitations - hardware threads, pipelines, cache coherence
- Fundamental concepts related to multithreaded programming (multithreaded program correctness, liveness, starvation, deadlock, race condition, atomicity, memory models, Flynn's taxonomy)
- Mechanisms available in C++ for implementing multithreading and multiprocessing
- Standard library implementation - elements from C++14 to the present day (C++2a)
- Implementation available in Boost - differences compared to the standard library
Processes and threads
- Multiprocess and multithreaded applications
- Operating system and threads (brief overview of available implementations)
- Process and thread synchronization mechanisms
- Structural implementation of synchronization
- Specifics of multithreading implementation in an object-oriented approach (role of the RAII pattern)
Memory model in C++
- Objects and memory locations
- Serialization of operations and their enforcement
- Relations: synchronization, precedence, ordering operations for atomic actions, release sequences
- Memory barriers
- Atomic operations
Thread management in C++14 and newer standards
- std::thread class and launching threads
- Thread identification
- Attaching and detaching threads
- Threads and standard containers
- Exception handling in C++14 threads
Mutual exclusion and critical sections
- Simple rules of mutual exclusion
- Concepts (types) of available lock objects
- Quick introduction to time handling in C++14 (chrono library)
- std::mutex, std::timed_mutex, std::shared_mutex classes and derived ones
- 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
- Reader-writer 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)
- Thread resumption
- Communication between threads (Actor and CSP models)
Asynchronous tasks
- Asynchronous events and their handling
- Futures
- Promises
- Packaged tasks
Atomic types
- Standard atomic types
- Universal atomic flag (std::atomic_flag)
- 'std::atomic[T]' class template and its specializations
- Tool functions (free) of std::atomic types
Specifics of multithreaded API design
- Designing structures using locks - coarse-grained and fine-grained locks
- Performance of concurrent code - 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 tests
- Formal methods of testing multithreaded applications
- Multithreaded application architecture patterns vs. testing and debugging (overview)
Advanced thread management
- Dependent threads (Sagi pattern)
- Avoiding data access competition
- Controlled stopping and interrupting of a thread
- Interrupting blocking calls
- Handling interruptions
- Task stealing
- Interrupting tasks during application shutdown
Multithreading design patterns
- Types and purpose of multithreading patterns
- Scope of pattern application
- 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 the GNU/Linux and/or MS Windows environment
- Knowledge of C++ programming issues (procedural and object-oriented paradigms) at an advanced and intermediate level
- Knowledge of generalized code creation issues (templates)
Testimonials (1)
Practical examples