Question: Question 3 : Synchronization ( 3 0 points ) ( This question is related to ILO 2 c - explain the underlying causes of concurrency
Question : Synchronization points
This question is related to ILO c "explain the underlying causes of concurrency and deadlock issues".
There is a high rating burger store near HKU. This store only serves takeaway with a chef stationed in the store. There is a limited number of chairs for customers to wait for their orders. The interaction and behavior between customers and the chef are as follows:
If there are no customers waiting, the chef switches off the stove and waits for a customer.
When a customer arrives and finds an available seat, the customer sits down and waits for their burger.
If all chairs are occupied, the customer goes away.
When the chef notices there are waiting customers, the chef fires up the stove if it is not already on prepares the burger, then places it on the front bench, and informs a customer to pick it up
The customer gets the burger and leaves the store.
Implement a solution to this problem using condition variables and mutex variables only. You can use the following variables and functions:
N the number of chairs
stove the state of the stove
prepareburger& placeburgerontable for the chef
getburger& goaway for the customer
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
