Thursday 22 September 2011

Process Synchronization : Semaphores




Semaphore is a "process synchronization tool" which are assigned by two operation 
a. wait (p)
b. signal (v)
It states that if there are many proceess sharing a same variable, then other process must wait it until the process in critical section is completed, as the process in critical section is completed its send a signal to the other process to enter a critical section.
Semaphores provide mutual exclusion. They are used for process sync and are used to resolve deadlock conditions. 
System semaphores are used by the operating system to control system resources. A program can be assigned a resource by getting a semaphore (via a system call to the operating system). When the resource is no longer needed, the semaphore is returned to the operating system, which can then allocate it to another program.
  For More explanation and Algorithm visit this link. Click here....

0 comments:

Post a Comment