Multicore Game Development: C++11 Practices

Added:

Multi-core Gaming
Threading Patterns
Dedicated Threads
Task Schedulers
Atomic Ops
Lock-Free Bug
C++11 Atomics
Consistency Models
Migrating Example
Key Takeaways

Multi-core Gaming

0:01
Playing Section
  • 1

    Introduces multi-core programming challenges in game development at Ubisoft.

  • 2

    Highlights the gap between game industry practices and the wider C++ community.

  • 3

    Aims to bridge the two communities by sharing techniques and standards.

Fundamental understanding of multithreading concepts, including threads, race conditions, mutual exclusion (mutexes), and critical sections.
Proficiency in C++ programming, particularly with memory management, pointers, and reference semantics prior to the C++11 standard.
Basic knowledge of CPU cache hierarchies, including L1/L2/L3 caches, cache lines, and the concept of false sharing.
Familiarity with basic data structures (such as queues, stacks, and linked lists) and how they operate in a single-threaded context.
Implementation of lock-free and wait-free data structures using C++ std::atomic and fine-grained memory ordering (acquire-release semantics).
Design and development of task-based job systems and work-stealing schedulers tailored for real-time game engines.
Advanced performance profiling and debugging of concurrent applications using tools like Intel VTune, Tracy Profiler, or ThreadSanitizer.
Exploration of modern C++ concurrency features introduced in C++20 and C++23, such as coroutines, std::jthread, and barriers.
52.7K views806likes1:04:33@CppConOriginal Release: 2014-10-23

This talk by Jeff Preshing from Ubisoft Montreal explains how the gaming industry approaches multicore programming through three threading patterns (pipelining, dedicated threads, and task schedulers) and demonstrates how C++11's atomic library provides formal specifications and portable guarantees for concurrent programming, contrasting sequentially consistent atomics (easier to reason about but potentially slower) with low-level atomics (more efficient but harder to use correctly), while highlighting the importance of avoiding data races and understanding memory ordering constraints.