Home Knowledge Base Mutex and Semaphore

Mutex and Semaphore — synchronization primitives that control access to shared resources in concurrent programs.

Mutex (Mutual Exclusion Lock)

mutex.lock()
// critical section — only one thread here
mutex.unlock()

Semaphore

Other Synchronization Primitives

Performance Tip

Choosing the right synchronization primitive is critical for both correctness and performance.

mutex semaphorelock synchronizationcritical section

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.