Question: Suppose that you had created an OS facility that implemented monitors, but not condition variables. Show how to implement condition variables using Dijkstra semaphores.
Suppose that you had created an OS facility that implemented monitors, but not condition variables. Show how to implement condition variables using Dijkstra semaphores.
Step by Step Solution
3.40 Rating (172 Votes )
There are 3 Steps involved in it
Condition variables are just signaling semaphores such as the fullempty semaphores in the bounded buffer problem The solution to this problem requires that you know how mutual exclusion is implemented in the monitor Then the condition variable wait code must enqueue the thread and release the mutual exclusion Similarly the signal code obtains mutually exclusive access to the monitor and dequeues a thread You will need to provide some guidance as to the amount of detail you want as an acceptable solution to this problem Here is some pseudo code that has only been debugged by eye struct monitort private semaphore ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
34-E-CE-OS (464).docx
120 KBs Word File
