Ask Question

Suppose we replace the wait () and signal () operations of monitors with a single construct await (B), where B is a general Boolean expression that causes the process executing it to wait until B become true. Explain why, in general, this construct cannot be implemented efficiently.

+4
Answers (1)
  1. 10 August, 01:02
    0
    Check the explanation

    Explanation:

    There is Only a single process can be active within the monitor at any given time. Other processes will be there waiting in the condition or IF variable. Whenever a process exits the monitor, it might or might not exit the variable in such state that makes B true. In the event that it's not same as B, then all threads that are waiting need to be awoken to check if their condition is true or not.

    That means, the system would have to test which one out of the waiting threads have to be activated by checking their condition if it's satisfying or not. Therefore, the monitor exits would be a very expensive operation given all that is required to wake up all the waiting threads. This involves some amount of complexity.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Suppose we replace the wait () and signal () operations of monitors with a single construct await (B), where B is a general Boolean ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers