Get in Touch
 Duration 28 hours

Course Outline

Challenges and Concurrency Issues

  • Hardware platform limitations - hardware threads, pipelines, cache coherence
  • Fundamental concepts related to multithreading (correctness of multithreaded programs, liveness, starvation, deadlock, race conditions, atomicity, coherence models, Flynn's taxonomy)
  • Available C++ mechanisms for implementing multithreading and multiprocessor systems
  • Standard library implementation - components from C++14 to the present (C++2a)
  • Boost implementation - differences compared to the standard library

Processes and Threads

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

Memory Model in C++

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

Thread Management in C++14 and Later Standards

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

Mutual Exclusion and Critical Sections

  • Basic mutual exclusion rules
  • 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 derived classes
  • RAII pattern in lock handling (std::lock_guard, std::unique_lock)
  • Dependent and deferred locks (std::lock)
  • Lock ownership and thread ownership
  • Readers-writers problem
  • One-time initialization
  • Thread-local (private) memory (std::thread_local)

Thread Locks and Synchronization

  • Semaphore operations
  • Recursive locks
  • Locks with locking level definitions
  • Decision variables and cooperation with locks
  • Implementation of active and passive barriers (Idle Waits, Busy Waits)
  • Thread resumption
  • 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)
  • std::atomic[T] class template and its specializations
  • Utility (free) functions 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 and exception handling in application architecture

Testing and Debugging Multithreaded Applications

  • Code reviews for multithreaded operations
  • Specifics of multithreaded application testing
  • Unit tests
  • Increasing the probability of failure scenarios for testing purposes
  • Formal methods for testing multithreaded applications
  • Multithreaded application architecture patterns vs. testing and debugging (overview)

Advanced Thread Management

  • Dependent threads (Saga pattern)
  • Avoiding data access contention
  • Controlled thread stoppage and interruption
  • Blocking call interruption
  • Interruption handling
  • Task stealing
  • Task interruption during application shutdown

Multithreading Design Patterns

  • Types and purposes 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 C++ software development tools in GNU/Linux and/or MS Windows environments
  • Knowledge of C++ programming topics (procedural and object-oriented paradigms) at advanced and upper-intermediate levels
  • Knowledge of generic code creation topics (templates)

Testimonials (1)

Related Categories