kuniga.me > Docs > Operating Systems Cheat Sheet
Common definitions and terminology in operating systems.
For Linux specifics, see the Linux Cheat Sheet.
It’s a type of lock. Stands for mutually exclusive lock.
When a thread tries to acquire a already locked Mutex, the kernel puts that thread to sleep and it will be awakened once the lock is unlocked.
A semaphore is a more generalized version of a lock because it supports up to N
threads to “enter” on a exclusive region.
If N = 1
, it behaves like a lock, albeit an expensive one.
It’s a type of lock that keeps trying to acquire a lock in a loop. It doesn’t require the thread to be context-switched, but consumes CPU cycles.