Presentation: Looking Inside a Race Detector


5:25pm - 6:15pm


Key Takeaways

  • Appreciate the problems and challenges around data race detection.
  • Understand the core computer science concepts that enable dynamic (and to a lesser extent static) race detection.
  • Understand the implementation of these concepts in a practical race detector, namely the Go Race Detector.


Writing race-free concurrent code is hard. Debugging racy concurrent code is even harder. Race detectors are seriously cool tools that make both easy -- they detect the race conditions in a program.

But race conditions are arguably the most elusive programming errors, so how do race detectors detect them?

This talk will explore the internals of the Go race detector to answer that question. We will delve into the compiler instrumentation of the program, and the run-time module that detects data races. We will touch upon the optimizations that make the dynamic race detector practical for use in the real world, and evaluate how practical it really is.


QCon: You work for Samara. What kind of work are you doing there?

Kavya: Samsara is an IoT start-up that provides real-time monitoring for industry applications. I primarily work on backend and infrastructure, so the focus of my day-to-day is building and scaling the workhorse between the sensors and the dashboards.

QCon: What are some of the use cases you are tackling?

Kavya: The areas we see the largest traction in right now are fleet monitoring and environmental monitoring. For example, if you’re in the food manufacturing industry, you would need to track things like where your delivery fleet vehicles are and view vehicle diagnostics remotely, and also monitor the temperature inside the vehicles -- we provide insights on a number of operational concerns like that.

QCon: What are some of the key areas you’ll discuss in the talk?

Kavya: The first half of the talk will explain the fundamental concepts and theory behind one type of dynamic race detection. We’ll see how ideas like the happens-before relationship ( and vector clocks ( -- that have typically been discussed in the context of distributed systems -- apply to the problem of race detection.

The second half will explore how the theory is implemented in the Go race detector. Many times, in computer science, academic research cannot be applied in practice easily because it turns out to be too complex to implement correctly, or not performant. That’s not the case here. We’ll see how the theory is implemented in a practical and performant race detector. The talk will use code, compiler output and is targeted at developers.

Speaker: Kavya Joshi

Software Engineer @Samsara

Kavya Joshi writes code for a living at a start-up in San Francisco. She particularly enjoys architecting and building highly concurrent, highly scalable systems. In her free time, she reads non-fiction and climbs rocks. Before moving to San Francisco to be an Adult, Kavya was at MIT where she got a Bachelor's and Master's in Computer Science.

Find Kavya Joshi at



Monday Nov 7

Tuesday Nov 8

Wednesday Nov 9

Conference for Professional Software Developers