Archiv verlassen und diese Seite im Standarddesign anzeigen : IPC-Tech Frage!

2002-11-27, 20:03:25
Kann mir jemand kurz und bündig erklären was Semaphore sind bzw. ist und möglicherweise Verweise auf weitere Erklärungen liefern?


El Fantastico
2002-11-28, 09:40:37
Ich zitiere :)

Semaphores are data structures that are used for synchronization between two or more processes. Basically they can be viewed as a single integer that represents the amout of resources avaialable. When a process wants a resource, it checks the value of the semaphore, and if it it nonzero, it decrements the appropriate number from the semaphore in accordance to the amout of resources it wishes to use. The kernel will block the process if the semaphore is zero or doesn't have a value high enough for the decrement. In System V IPC, you may request a set or an array of semaphores at once.