680 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

0 votes
0 votes
1 answer
4