710 views
0 votes
0 votes
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 primitive, waituntil, that had an arbitrary Boolean predicate as parameter. Thus, one could say, for example, $$\text{waituntil}\: x < 0 \:\text{or}\: y + z < n$$ The signal primitive would no longer be needed. This scheme is clearly more general than that of Hoare or Brinch Hansen, but it is not used. Why not? (Hint: Think about the implementation.)

1 Answer

0 votes
0 votes

Answer:

It is very costly and difficult to implement. Every time for any variable which becomes visible in a predicate on which some other process is waiting for a change, then the run-time system has to evaluate the predicate again to look if it is possible to unblock the process.

With the help of Hoare and Brinch Hansen monitors, it is possible to awaken the process only on a signal primitive.

 

 

 

Related questions

745
views
0 answers
0 votes
admin asked Oct 25, 2019
745 views
Write a producer-consumer problem that uses threads and shares a common buffer. However, do not use semaphores or any other synchronization primitives to guard ... one number every minute because the I/O could affect the race conditions.
820
views
0 answers
0 votes
admin asked Oct 25, 2019
820 views
Suppose that a university wants to show off how politically correct it is by applying the U.S. Supreme Court's Separate but equal is ... woman_leaves, man_leaves. You may use whatever counters and synchronization techniques you like.
344
views
0 answers
0 votes
admin asked Oct 25, 2019
344 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 ... threads in any other processes have access to the semaphore. Discuss your answers.
1.1k
views
1 answers
0 votes
admin asked Oct 25, 2019
1,131 views
How could an operating system that can disable interrupts implement semaphores?