index.md (447B)
1 --- 2 title: "Exercise: Spinlock" 3 tags: [exercise, rust, concurrency, memory-safety] 4 --- 5 6 A from-scratch implementation of a [spinlock](memory_safety/spinlock.md) in Rust 7 using atomics and `UnsafeCell`. The goal is to understand how a mutex works at 8 the lowest level — without relying on the OS scheduler. 9 10 > [!info] Source Code: 11 > [exercises/spinlock/src/main.rs](https://github.com/ling0x/notes/blob/main/content/exercises/spinlock/src/main.rs)