Question: Time left 0 : 5 4 : 0 4 Question 2 Not yet answered Marked out of 5 . 0 0 Flag question Question text
Time left ::
Question
Not yet answered
Marked out of
Flag question
Question text
The WashOMatic Laundromat is a computerized laundry reservation system. As each customer enters, he or she puts coins into slots at one of two stations and types in the number of washing machines heshe will need. The stations are connected to a central computer that automatically assigns available machines and outputs tokens that identify the machines to be used. The customer puts laundry into the machines and inserts each token into the machine indicated on the token. When a machine finishes its cycle, it informs the computer that it is available again. The computer maintains an array availableNMACHINES whose elements are nonzero if the corresponding machine is available; NMACHINES is a constant equal to the number of machines there are in the Laundromat, and nfree is a semaphore that indicates the number of available machines.
The code to allocate and release machines is as follows:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
