Overview

Synchronization Primitives are software abstractions built on top of hardware atomic instructions (or interrupt disabling) that allow concurrent threads to safely access shared resources, enforce mutual exclusion, and coordinate execution timing.


Core Primitives

Primitive LinkDescriptionPrimary Mechanism / APIPrimary Use Case
LocksEnforces strict mutual exclusion across critical sections. Evolves from hardware spinlocks to guarded sleep locks.acquire(), release(), test_and_set()Mutual Exclusion (Single Thread in Critical Section)
SemaphoresDijkstra’s non-negative integer variable. Retains event history to manage resource pools and timing sequences.wait() (), signal() (), Counter + Wait QueueMutual Exclusion () AND Event Sequencing ()
Condition VariablesMemoryless synchronization queues allowing threads to sleep inside critical sections by atomically releasing locks.wait(), signal(), broadcast() (Mesa Semantics)Waiting for complex shared state conditions
MonitorsLanguage-level constructs encapsulating shared data and routines with compiler-enforced implicit mutual exclusion and internal CVs.Encapsulated Procedures + Implicit Locks + Internal CVsStructured, language-supported thread synchronization

Related Modules