Question: Please use C language to implement, needed ASAP Implement a synchronization scheme that simulates the behavior of the customers of a bank as follows: The
Please use C language to implement, needed ASAP
Implement a synchronization scheme that simulates the behavior of the customers of a bank as follows: The bank acquires K seats in the waiting room and a customer service desk. The customers can see from the window if there is free seating. If there is not, they go for a walk (take_a_walk Q) and retry later. If there is seating available, they enter the waiting room and attempt to be served one at a time in the customer service desk. The client is served by calling make transaction (). Use shared variables and semaphores for your solution. Consider making any changes necessary at the points indicated with. ... in the code segment that follows: void bank_client() {while (1) {if (.. .) {/* if seats available */make_transaction(); break;} else {take_a_walk();}} return_home();}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
