Strange Loop

Using Race Conditions in Correct Concurrent Software

If you've ever worked on concurrent or parallel systems, race conditions have invariably plagued your existence. They are difficult to identify, debug, and nearly impossible to test repeatably. While race conditions intuitively seem bad, it turns out there are cases in which we can use them to our advantage! In this talk, we'll discuss a number of ways that race conditions -- and correctly detecting them -- are used in improving throughput and reducing latency in high-performance systems.

We begin this exploration with a brief discussion of the various types of locks, non-blocking algorithms, and the benefits thereof. We'll look at a naive test-and-set spinlock and show how introducing a race condition on reads significantly improves lock acquisition throughput. From here, we'll investigate non-blocking algorithms and how they incorporate detection of race events to ensure correct, deterministic, and bounded behavior by analyzing a durable, lock-free memory allocator written in C using the Concurrency Kit library.

Devon O'Dell

Devon O'Dell


Devon H. O'Dell is a recovering competitive Guitar Hero and Rock Band addict, but still occasionally enjoys rhythm games and jamming on his ESP Ltd H7-2015. Today, he is a software engineer at Fastly, where he contributes primarily to the performance and debugging of low-level systems. Prior to Fastly, Devon was Lead Software Architect at Message Systems, and contributed heavily to the Momentum high-performance messaging platform. His experience over the last 15 years ranges from web applications to embedded systems firmware (and most areas in-between). His primary technical interests are developing and debugging high-performance, concurrent network systems software and related tools.