Preventing Data Races in Async Coroutines

May 04, 2023 17 min Free

Description

In this talk, Kevin Bierhoff explores techniques used at Google to detect and prevent race conditions in asynchronous coroutines. He discusses static analysis to flag potentially racy code at compile time and the use of TSAN (Thread Sanitizer) to detect race conditions during multithreaded test execution. The presentation covers how to make data safe for concurrent access through immutability and proper synchronization mechanisms like mutexes, and touches upon the implementation of these analyses using Android lint for both Java and Kotlin.