Question: The decrease count() function in the previous exercise currently returns 0 if sufficient resources are available and -1 otherwise. This leads to awkward programming for
while (decrease count(count) == -1)
;
Rewrite the resource-manager code segment using a monitor and condition variables so that the decrease count() function suspends the process until sufficient resources are available. This will allow a process to invoke decrease count() by simply calling
decrease count(count);
The process will only return from this function call when sufficient resources are available.
Step by Step Solution
3.44 Rating (170 Votes )
There are 3 Steps involved in it
monitor resources int availableresources condition ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
926-B-F-R-A (139).docx
120 KBs Word File
