↓ Skip to main content
  1. Home projects/

C++ concurrency and real-time Linux training

··Index: 9·

In 2013 and 2014 I ran three-day C++ courses in Kraków for programmers who had to write concurrent and real-time code. Most of each day was spent on short examples that people ran and changed themselves, followed by exercises. On the first morning everybody cloned the repository. 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 how to write multithreaded code that is correct. We went through creating threads and passing arguments to them, dangling references, joining safely with RAII, thread groups, thread-specific storage, interrupting threads and dealing with exceptions thrown in one of them. Among the exercises were a multithreaded sum and computing π in parallel. Materials.

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

Two three-day C++ courses: threads, and real-time programming on Linux, with topics listed for eachday one: clone the repository, set up the virtual machine, proxy and gitThreads in C++Real-time C++ on Linuxcreating threads, passing argumentsdangling referencesjoining safely with RAIIthread groups, thread-specific storageinterrupting threadsexceptions thrown in a threadexercises: multithreaded sum,computing pi in paralleltypes of mutexesproducer-consumer, thread-safe queuesthread priorities: Boost and POSIXscheduling policies, CPU affinitymeasuring context switcheswriting a character devicereal-time threads for ordinary users
Topics of the two courses as they were listed in the notes

Related