Synchronization Primitives: Difference between revisions
Jump to navigation
Jump to search
m
Formating and link fixes
[unchecked revision] | [unchecked revision] |
No edit summary |
m (Formating and link fixes) |
||
Line 8:
* Shared readers/Single writer approach of resource locking: many process may be reading a table at the same time, but only one can write at a time and it should prevent readers to access the table until the table has returned to a consistent state.
== Semaphores ==
Semaphores are one of the oldest and most widely used methods of ensuring [[Mutual Exclusion]] between two or more processes. A semaphore is a special integer variable which is (usually) initialized to 1, and can only altered by a pair of functions. Each of these functions, historically called
The function ''p'', also called <tt>wait()</tt> (or <tt>test()</tt>), decrements the value of the semaphore, and if the semaphore is negative, puts the process on the waiting queue until the semaphore is released by the process holding it.
Line 64:
==See Also==
===Threads===
*[[Topic:9440|Userland only Semaphores
*[[Topic:10363|Spinlocks that disable interrupts
*[[Topic:9699|SMP compatibility
*[[Topic:14261|Mutex Implementation]]
*[[Topic:11903|Mutexs, Spinlocks and all that jazz]]
*[[Topic:7500|Spinlocks & Semaphores]]
[[Category:IPC]]
|