Get in Touch
 Duration 28 hours

Course Outline

Concurrency Challenges and Issues

  • Hardware platform limitations – hardware threads, pipelines, cache coherence
  • Elementary concepts related to multithread programming (correctness of multithread programs, liveness, starvation, deadlock, race conditions, atomicity, memory models, Flynn's taxonomy)
  • Available multithreading and multiprocessing implementation mechanisms in C++
  • Standard library implementation – elements from C++14 to the present (C++2a)
  • Implementation available in Boost – differences compared to the standard library

Processes and Threads

  • Multiprocess vs. multithread applications
  • Operating system and threads (brief overview of available implementations)
  • Process and thread synchronization mechanisms
  • Structural implementation of synchronization
  • Specifics of multithread implementation in the object-oriented approach (role of the RAII pattern)

Memory Model in C++

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

Thread Management in C++14 and Newer Standards

  • The std::thread class and thread execution
  • Thread identification
  • Thread joining and detachment
  • Threads and standard containers
  • Exception handling in C++14 threads

Mutual Exclusion and Critical Sections

  • Basic principles of mutual exclusion
  • Concepts (types) of available blocking objects
  • Quick introduction to time handling in C++14 (chrono library)
  • Classes std::mutex, std::timed_mutex, std::shared_mutex and derivatives
  • RAII pattern in lock handling (std::lock_guard, std::unique_lock)
  • Dependent and deferred locks (std::lock)
  • Ownership and shared ownership of locks and threads
  • Readers-Writers problem
  • One-time initialization
  • Thread-local (private) memory (std::thread_local)

Locks and Thread Synchronization

  • Operations on semaphores
  • Recursive locks
  • Locks with defined lock levels
  • Decision variables and cooperation with locks
  • Implementation of active and passive barriers (Idle Waits, Busy Waits)
  • Resuming thread execution
  • Inter-thread communication (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)
  • Class template "std::atomic<T>" and its specializations
  • Utility functions (free functions) for std::atomic types

Specifics of Multithread 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 Multithread Applications

  • Code reviews focusing on multithread operations
  • Specifics of testing multithread applications
  • Unit tests
  • Increasing the likelihood of critical scenarios for testing purposes
  • Formal methods for testing multithread applications
  • Multithread application architecture patterns vs. testing and debugging (overview)

Advanced Thread Management

  • Dependent threads (Saga pattern)
  • Avoiding contention in data access
  • Controlled thread termination and interruption
  • Interruption of blocking calls
  • Handling interruptions
  • Work stealing
  • Interrupting tasks during application shutdown

Multithreading Design Patterns

  • Types and purposes of multithread patterns
  • Scope of pattern application
  • Thread Pool
  • Active Object pattern
  • Thread-Safe Queue
  • Producer-Consumer pattern
  • Monitor pattern
  • Multithread safety of GoF patterns

Requirements

  • Ability to use C++ software development tools in GNU/Linux and/or MS Windows environments
  • Knowledge of C++ programming concepts (both procedural and object-oriented paradigms) at an advanced or intermediate level
  • Familiarity with generic code creation concepts (templates)

Number of participants


Price per participant

Testimonials (1)

Upcoming Courses

Related Categories