↓ Skip to main content
  1. Home projects/

C++ concurrency and real-time Linux training

··

In 2013 and 2014 I ran three-day C++ training courses in Kraków for programmers who needed to write concurrent and real-time code. The courses were hands-on: each day was a set of short examples to run and change, followed by exercises. The participants cloned the repository on the first morning, and the notes started with setting up the virtual machine, the proxy and git, so that nobody lost time on the environment.

Threads in C++ was about writing correct multithreaded code: creating threads and passing arguments, dangling references, joining threads safely with RAII, how much hardware concurrency there really is, thread groups and thread-specific storage, movable threads, interrupting threads and handling exceptions across them. The exercises included a multithreaded sum and computing π in parallel. Materials.

Real-time C++ on Linux went further: mutexes and their types, producer–consumer queues and a thread-safe queue, thread priorities with Boost and POSIX, and the real-time side of Linux itself: scheduling policies and priorities (chrt), CPU affinity, measuring context switches, a character device, and how to let an ordinary user run real-time threads with rtprio limits. Part 1, part 2.

Related