Knock, knock. Race condition! Who's there? — A Refactoring Story
RustNLKnock, knock. Race condition! Who's there? — A Refactoring Story by Stefan Baumgartner. Concurrency in Rust can be hard, especially when the language throws other obstacles in your way. Like with this request that found me one day. What started as a humble ask to remove some indentation and nesting turned into a crime scene of concurrency gone wrong. Innocent memory being shared across tasks. A supervision task that made everything worse. A race condition waiting to strike. In this talk, we will apply refactoring techniques that address structure, ownership, and readability, while simultaneously making the actual problem visible. We'll solve the emerging concurrency problem by identifying what we actually want to accomplish, then turn everything upside down. In doing so, we'll rediscover proven patterns for async programming that predate async Rust but remain relevant today. About Stefan Baumgartner (he/him): Stefan Baumgartner is an architect and developer based in Austria. He is the author of "TypeScript in 50 Lessons" (Smashing Magazine, 2020) and "The TypeScript Cookbook" (O'Reilly, 2023). In his spare time, he organizes ScriptConf and Rust Linz. Stefan enjoys Italian food, Belgian beer, and British vinyl records. - bluesky: https://bsky.app/profile/deadparrot.dev - linkedin: https://www.linkedin.com/in/stefan-baumgartner-bb621564/ This talk was given at RustWeek 2026 as part of the Main track on Tuesday 19 May. You can find a playlist of all talks in this track at https://www.youtube.com/playlist?list=PL8Q1w7Ff68DCvQXADosMcF0aMvLhGXU4S, and a playlist of all RustWeek 2026 talks at https://www.youtube.com/playlist?list=PL8Q1w7Ff68DBpmF38rcIAf8Z9Gj2TnlgM For information about RustWeek 2027, go to https://2027.rustweek.org. We hope to see you there!