Ask Question
28 April, 09:58

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.

+1
Answers (1)
  1. 28 April, 13:25
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers