1,466 views

1 Answer

0 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.

Position:
Show:

Related questions

0 0 votes
1 1 answer
1.0k
1.0k views
admin asked Oct 25, 2019
1,027 views
Synchronization within monitors uses condition variables and two special operations, wait and signal. A more general form of synchronization would be to have a single pri...
0 0 votes
0 0 answers
497
497 views
admin asked Oct 25, 2019
497 views
Can two threads in the same process synchronize using a kernel semaphore if the threads are implemented by the kernel? What if they are implemented in user space? Assume ...
1 1 vote
0 0 answers
592
592 views
admin asked Oct 24, 2019
592 views
Suppose that an operating system does not have anything like the select system call to see in advance if it is safe to read from a file, pipe, or device, but it does allo...
0 0 votes
1 1 answer
1.7k
1.7k views
admin asked Oct 24, 2019
1,685 views
Consider a system in which threads are implemented entirely in user space, with the run-time system getting a clock interrupt once a second. Suppose that a clock interrup...