1,022 views

1 Answer

0 votes
0 votes

Answer:

The operating system disables interrupts for doing the semaphore operation. After this it reads out the value of the semaphore, if the value is down and the value of the semaphore is $0$, it keeps the calling processes in the list containing all the blocked processes which are connected with the semaphore.

If the semaphore is performing an up operation, it must inspect to see if there is any processes that are blocked on the semaphore. One of the processes is eliminated from the list containing the blocked processes and is made runnable if one or the more processes are blocked.

After the completion of these operations, we can enable the interrupts again.

Related questions