Course Outline
Concurrency challenges and problems
- Platform hardware limitations - hardware threads, pipes, cache coherence
- Elementary concepts related to multithreaded programming (multithreaded program correctness, lifetime, starvation, deadlock, race, atomicity, consistency models, Flynn's taxonomy)
- Mechanisms for implementing multithreading and multiprocessing available in C++.
- Standard library implementation - elements from C++14 to present (C++2a)
- Implementation available in Boost - differences from the standard library
Processes and threads
- Multiprocess and multithreaded applications
- Operating system and threads (a brief overview of available implementations)
- Process and thread synchronization mechanisms
- Structural implementation of synchronization
- Specificity of the implementation of multithreading in the object-oriented approach (role of the RAII pattern)
Memory model in language C++
- Objects and places in memory
- Scheduling operations and enforcing them
- Relations: synchronization, priming, ordering of operations for atomic actions, release sequences
- Memory barriers
- Atomic operations
Thread management in standard C++14 and newer
- The std::thread class and starting threads
- Thread identification
- Attaching and detaching a thread
- Threads and standard containers
- Exception handling in threads C++14
Mutual exclusion and critical sections
- Simple rules of mutual exclusion
- Concepts (types) of available locking objects
- Quick introduction to time handling in C++14 (chrono library)
- Classes std::mutex, std::timed_mutex, std::shared_mutex and derivatives
- RAII pattern for lock handling (std::lock_guard, std::unique_lock)
- Dependent and deferred locks (std::lock)
- Ownership and co-ownership of locks and threads
- The reader-writer problem
- One-time initialization
- Thread-local (private) memory (std::thread_local)
Locks and thread synchronization
- Operations on semaphores
- Recursive locks
- Locks with lock level definition
- Decision variables and interlock cooperation
- Implementation of active and passive barriers (Idle Waits, Busy Waits)
- Resuming threads
- Communication between threads (Actor and CSP model)
Asynchronous tasks
- Asynchronous events and their handling
- Future
- Promises (promises)
- Prepared tasks (packaged_task)
Atomic types
- Standard atomic types
- Universal atomic flag (std::atomic_flag)
- The std::atomic<T> class template and its specializations
- Utility functions (free) of types std::atomic
Specifics of multi-threaded API design
- Designing structures using interlocks - coarse and fine-grained interlocks
- Concurrent code performance - estimation and measurement techniques
- Data partitioning
- Scalability of solutions
- Handling errors and exceptional situations in the application architecture
Testing and debugging multi-threaded applications
- Code reviews for multi-threaded operations
- Specifics of testing multi-threaded applications
- Unit tests
- Increasing the probability of contingencies for testing
- Formal methods for testing multithreaded applications
- Multithreaded Application Architecture Patterns and Testing and Debugging (Overview)
Advanced thread management
- Dependent threads (Saga pattern)
- Avoiding competition in access to data
- Controlled stopping and interruption of the thread
- Interrupting blocking calls
- Interrupt handling
- Stealing tasks
- Interrupting tasks when the application ends
Multithreading design patterns
- Types and purpose of multithreaded patterns
- Scope of application of patterns
- Thread Pool
- Active Object Pattern
- Thread Safe Queue
- Producer Consumer Pattern
- Monitor pattern
- Multithreaded security patterns GoF
Requirements
- Ability to use software development tools in C++ in a GNU/Linux and/or MS Windows environment
- Knowledge of programming issues in C++ (procedural and object-oriented paradigm) at advanced and intermediate level
- Knowledge of creating generalized code (templates)
Testimonials (5)
Enjoyed the flexibility and variety of topics, the combination of trainings and exercises meant that I could apply what I'd learnt straight away. I also enjoyed the projects on the last day to bring everything together.
Luca Ricagni - Rockwell Collins UK Limited
Course - Advanced C++
The instructor's excellent level of knowledge, willingness, and kindness.
Luis Antonio Salazar Rivero - Banco de Mexico
Course - C/C++ Secure Coding
Machine Translated
Interactivity, time for self-contained programming. I learn easier if I have the chance to find out the answer and not just telling me it. It was also a very good thing that the training was well-planned, we kept coffee pauses and the training did not lose my attention. The trainer had very deep knowledge in C++, we felt we could ask anything.
Barna Szecsi - GIS Europe SE
Course - C++ for Embedded Systems
The instructor's knowledge.
Juan Jose Lopez Martinez - Banco de Mexico
Course - Advanced C++ Software Design
Machine Translated
The details on how compiler behaves depending on to the syntax usage. The "Quiz" sections are very stimulating