Anonymous user
Semaphore: Difference between revisions
m
Typo, better wording
(Added less technical description, roll back if I'm wrong.) |
m (Typo, better wording) |
||
Line 3:
'''Semaphore''' is a synchronization object proposed by Edsger Dijkstra. A semaphore is characterized by a natural number ''k''. A [[task]] may atomically increase or decrease ''k''. When ''k'' reaches 0 the tasks attempting to decrease it are blocked. These are released in an unspecified order when other tasks increase ''k'', one per increment.
The natural number ''k'' works like a count of available slots for resources. When you (
A semaphore is considered a low-level synchronization primitive. They are exposed to deadlocking.
|