Get in Touch
 Duration 28 hours

Course Outline

Challenges and concurrency issues

  • Hardware platform limitations - hardware threads, pipes, cache memory coherence
  • Basic concepts related to multithreaded programming (correctness of multithreaded programs, liveness, livelock, deadlock, race condition, atomacity, coherence models, Flynn's taxonomy)
  • C++ available mechanisms for implementing multithreading and multiprocessing
  • Standard library implementation - elements from C++14 to 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 synchronization implementation
  • Specifics of multithreading implementation in an object-oriented approach (role of RAII pattern)

Memory model in C++

  • Objects and memory locations
  • Operation scheduling and enforcement
  • Relations: synchronization, ordering, operation ordering for atomic actions, release sequences
  • Memory barriers
  • Atomic operations

Thread management in C++14 and newer standards

  • std::thread class and thread launching
  • Thread identification
  • Attaching and detaching threads
  • Threads and standard containers
  • Exception handling in C++14 threads

Mutual exclusion and critical sections

  • Basic rules of mutual exclusion
  • Concepts (types) of available locking 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
  • 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 execution 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)
  • Template class "std::atomic<T>" and its specializations
  • Helper (free) functions for 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 testing
  • Increasing the probability of failure scenarios for testing purposes
  • Formal methods for testing multithreaded applications
  • Multithreaded application architecture patterns and testing and debugging (overview)

Advanced thread management

  • Dependent threads (Sagas pattern)
  • Avoiding data access contention
  • Controlled stop and thread interruption
  • Interrupting blocking calls
  • Interrupt handling
  • Work stealing
  • Interrupting tasks while ending application execution

Multithreaded design patterns

  • Types and purposes of multithreaded patterns
  • Scope of pattern application
  • Thread Pool
  • Active Object pattern
  • Thread Safe Queue
  • Producer-Consumer pattern
  • Monitor pattern
  • Multithreaded 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 advanced and intermediate levels
  • Knowledge of generic code creation issues (templates)

Number of participants


Price per participant

Testimonials (1)

Upcoming Courses

Related Categories