Question: do fast urgently needed LAngauge c only subject operating system A group of workers need to carry boxes across a bridge. The bridge is weak,
do fast urgently needed
LAngauge c only
subject operating system
A group of workers need to carry boxes across a bridge. The bridge is weak, so only two workers can go across the bridge at a time. The boxes are heavy, so the two workers must carry one box at a time. There should be no unnecessary waiting, i.e., if two workers and one box is available, the bridge should be used.
A worker calls the procedure WorkerReady when she is ready to use the bridge. When a box is ready to be moved across the bridge, the procedure BoxReady is called. Together, these procedures provide one box to two workers and then call EnterBridge, after which the two workers carry the box across the bridge. Assume that the EnterBridge procedure correctly blocks the caller until the bridge has been crossed, and enough boxes are available for each worker. Assume also that the semaphore waiting queues are FCFS.
LAngauge c only
subject operating system
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
