Skip to main content
grasp.study
About
Explore
Pricing
Log in
Try it for free
Back to course
👋
Welcome to a Grasp lesson
Create a free account
to keep studying and create your own study path.
C programming with threads
·
Module 8
Atomic Operations and Lock-Free Basics
1
Implementing a Lock-Free Counter with C11 Atomics
Use C11 atomic types (_Atomic) to implement a lock-free counter.
2
Instruction Reordering and Concurrency Bugs
Describe how compiler and processor instruction reordering can cause concurrency bugs.
3
Memory Barriers for Ordering
Use memory barriers (fences) to enforce specific memory ordering guarantees.
4
Compare-and-Swap in Optimistic Concurrency
Explain the concept of a compare-and-swap (CAS) operation and its role in optimistic concurrency.
5
Lock-Free Stack with CAS
Implement a simple lock-free stack using atomic compare-and-swap operations.
6
ABA Problem in CAS Algorithms
Analyze the challenges of the ABA problem in CAS-based algorithms.
Previous module
Building a General-Purpose Thread Pool
Next module
Debugging Multithreaded Programs