OS-level view

A mutex (mutual exclusion lock) is a synchronization primitive that ensures only one thread at a time enters a critical section that uses some shared data.

If a thread tries to lock a mutex that is already locked, the OS (or runtime) either makes it spin briefly or puts it to sleep and queues it until the mutex is unlocked.

The OS uses low-level tools (like Linux futex on an integer in memory) plus atomics and memory fences to implement this reliably across cores.

3 items under this folder.