Wednesday 

Room 2 

15:00 - 16:00 

(UTC+02

Talk (60 min)

Threads vs. Coroutines: Understanding C++’s Concurrency Models

The C++11 standard introduced a powerful set of tools for concurrency, including threads, mutexes, condition variables, and futures. More recently, C++20 introduced coroutines, another powerful, but fundamentally different concurrency abstraction. However, coroutines are not just an evolution or a replacement for threads. Instead, they each solve different problems in different ways.

C++
OS

Choosing the right tool for the job requires understanding how each works under the hood and where they shine. By exploring how each interacts with the operating system and hardware, this talk will help software engineers build that intuition to make better decisions about which to use, and when to use them.

We'll explore how threads and synchronization primitives work at the operating system and hardware level, from thread creation and scheduling to where context switching and synchronization introduce performance costs. We’ll then contrast this to the coroutine model introduced in C++20, which takes a fundamentally different approach by using a cooperative model based on the suspension and resumption of work.

Given this understanding, we’ll apply this intuition to a set of real-world scenarios to identify whether threads or coroutines are a better fit for the problem at hand.

Conor Spilsbury

Conor Spilsbury is a Senior Software Engineer at Bloomberg, where he works on the Listed Securities’ Execution Management System (EMSX). EMSX is a high-performance, high-throughput multi-asset trading solution. Conor is also the chair of Bloomberg's C++ Guild. He holds a master’s degree in mathematics from the University of Exeter.