Wednesday, July 20, 2011

Semaphore

It was invented by Dijkstra in 1965 as a generalization of critical region. A semaphore was assigned an initial count. As long as the count is not zero, thread can continue to decrement the count without waiting. When thread leaves, it increases the count. Dijkstra invented 2 operations - P based on a fictitious word prolaag which means "try to take" and V which is a Dutch work "verhoog" meaning to increase.

Semaphore of value 1 is called binary semaphore. Semaphore of value more than 1 is called counting semaphore.

No comments: