11:00 AM • Duration: 45 Min
Locks are a common tool in concurrent programming, but they come with some significant drawbacks. They can slow down performance, cause deadlocks, lead to priority inversion, and make your code more complex and harder to manage. These challenges highlight the need for better solutions.
Enter lock-free data structures! When done right, they can eliminate the need for traditional locks by using atomic operations. This means threads can work together smoothly without getting stuck waiting for each other, making your programs faster and easier to understand.
We will explore how lock-free data structures can be implemented in zig, when/under what access patterns they perform best, and when they might be overkill. We will also touch on related concepts like progress guarantees, or different levels of “freeness”.
I’m Lukas, a research assistant at the Institute of Distributed Systems at Ulm University. I started to learn Zig for my talk at last year’s Zigtoberfest, and since then, I have been zigging around more and more :).