GAMES GATHERING 2019 KYIV

Multithreaded programming in modern C++

Talk recording: Multithreaded programming in modern C++

Ihor Maidanovskyi

Hall:
Programming Track

What the talk is about

Ihor Maidanovskyi explains how to build better multithreaded systems in modern C++ within a single process with shared memory. He walks through the typical problems: data races, logical race conditions and deadlocks. He covers the basic synchronization primitives (atomics, semaphore, condition variable, mutex) and shows how mixing them with business logic leads to bugs. His main advice is to separate logic from threading using an actor-like architecture, with thread-safe queues between input, a pool of workers and result output. This makes code simpler, lets you scale the worker pool, find bottlenecks and monitor data flow easily. For production he recommends ready-made queue implementations. The talk targets programmers with modest experience.