◄ Wiki / OS
semaphore
A counter used to coordinate threads, letting a limited number proceed while others wait.
A semaphore holds a count of available 'permits.' Threads decrement it to enter (blocking if it hits zero) and increment it to release, which safely limits concurrent access to a resource or signals that work is ready. The name is reused in graphics APIs like Vulkan for a different but related job: synchronizing operations across the GPU timeline.
See also
- spinlockA lock where a CPU waiting for it just keeps re-checking in a tight loop until it's free.
- schedulerThe part of an operating system that decides which thread runs on the CPU next, and switches between them.
- SMPA computer with multiple equal CPU cores that share the same memory and can all run tasks at once.
Referenced by
round-robin · scheduler · SMP · spinlock