An Adventure in Race Conditions

By Felix Petriconi

Chip speeds are not increasing, but the number of cores is, so the path to better performance is concurrency. But writing concurrent code is hard.

In this introduction to asynchronous programming, I’ll give you an outlook on high-level abstractions that will help you avoid the most common traps associated with locks and atomics.

I’ll use a series of code examples from our production to illustrate just how subtle race conditions can be. I’ll also share strategies that find these problems and better, avoid them in the first place and show that using high-level abstractions don’t result in performance loss.

The talk will cover the following topics:

  • Basic principles of code sharing in concurrent code

  • Mutability, mutex and locks

  • Atomics

  • Condition variables

  • Race conditions

  • Futures





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.