C++ – Threads, Coroutines and Asynchronous I/O (CPP4)
Programming, C, C++
Since C++11 the standard adds support for OS threads, a model for multithreaded programs and basic synchronization. This lets you build portable code with parallel computation, concurrent I/O and reliable synchronization across different platforms.
From C++20 the standard library adds many synchronization utilities and native coroutines, enabling lightweight cooperative tasks. C++26 adds tools for lock-free algorithms and data structures. The course covers Boost.Asio where needed.
Location, current course term
Contact us
The course:
Hide detail
-
Parallel programming in C++
-
Multithreading and multiprocessing
-
Coroutines and in-process scheduling
-
Synchronizing access to resources
-
Multithreaded data model
-
What can go wrong (undefined behavior)
-
When the language actually guarantees behavior
-
How to write correct parallel programs
-
Working with threads in C++
-
Starting and stopping threads
-
Waiting for thread completion
-
Main-thread termination and destructors
-
Classic thread synchronization
-
Locking shared data (mutex)
-
Notification via condition variables
-
Mutex performance in operating systems
-
Advanced synchronization tools
-
Signaling with semaphores
-
Other utilities (barrier, latch)
-
Futures and asynchronous execution
-
Object representing a future value (future)
-
Producer-side promise (promise)
-
Running functions in background threads (std::async)
-
Atomic variables and operations
-
Visibility of memory changes
-
Hardware and operation ordering (memory order)
-
Atomic ops and correct programs
-
Lock-free data structures
-
Using atomic operations (CAS)
-
Algorithmic properties (lock-free, wait-free)
-
The ABA problem
-
From custom implementations to C++26 and beyond
-
Data-structure updates via copy methods (RCU)
-
Support for pointer tagging (hazard pointers)
-
Bonus: transactional memory
-
Practical thread applications
-
Communication over TCP/IP
-
Applications on top of HTTP
-
Using existing thread pools
-
Asynchronous calls via callbacks
-
Scheduling actions with callbacks
-
Typed action objects (lambdas, captures)
-
The senders/receivers concept
-
Coroutines and asynchronous I/O
-
Motivation for using coroutines
-
External libraries with schedulers
-
Possible impacts in embedded systems
-
Principles of asynchronous I/O
-
Integrating scheduler and I/O
-
Computation versus communication
-
Interaction with multithreading
-
Asynchronous network communication
-
TCP/IP communication
-
HTTP server and client
-
Concurrency with other operations
-
Embedded systems and hardware I/O
-
Serial line communication
-
Local communication channels
-
OS interaction
-
Compute threads and coroutines
-
Coroutines focused on I/O work
-
CPU-bound versus I/O-bound tasks
-
Combining threads and coroutines
-
Assumed knowledge:
-
Good knowledge of C++ programming.
-
Recommended previous course:
-
C++ – Practical Programming for Advanced Developers (CPP2)
-
Schedule:
-
4 days (9:00 AM - 5:00 PM )
-
Language:
-
Vybrané zákaznické reference
ERA a.s., Libor M.
C++ – Threads, Coroutines and Asynchronous I/O (
CPP4)
"Kurz splnil má očekávání. Srozumitelný a jasný výklad probírané problematiky s odkazem na praxi."
ERA a.s., Vladimír N.
C++ – Threads, Coroutines and Asynchronous I/O (
CPP4)
"Vzhledem k obtížnosti a šíři tématu se lektor velice profesionálně orientoval, srovnání s jinými programovacími jazyky."