Computers and Technology

Kindly help me in this question by C PROGRAM or BY WORDINGS WHICH DESCRIBES THE PROBLEM SOLUTION Suppose you are owner of a Burger spot and you can make 10 burgers at max. Now, you have several customers to buy it, but let us consider only one customer. So you can make one burger at a time and customer take it. Implement this scenario using process(fork).
1. If your shop has 0 burger; then you need to send a message to all your customers to sleep(customer).
2. If your shop has 1 burger, then it sends the Customer a message that wakeup(customer).
3. Until chef make 10 burgers, chef is asked to continues to make burgers.
4. If burgers == 10, chef goes to sleep(chef) until customer buys a burger and chef continues to sleep until burger != 0. When burger == 0 then sends the chef a message to wakeup(chef).
But this management has some problems like:
• Chef is making burger and at the same time customer wants to take it. At the same time; the customer thinks that burger is ready while there are no burgers and hence is still producing. So, one can understand that it creates a mess!
• Now, customer just saw there are no burgers, then is about to go to sleep. Now, before customer goes to sleep; what if chef makes a burger? And after the chef has just made a burger; the shop sends the message to the customer “Wake up!”. But since, the customer is about to sleep(as he had got to know that there were no pizza), and hence he is still awake, so the “Wake Up” call of the baker is wasted! Actually that Wake-Up call was to awake the ‘Sleeping’ Customer! But due to lack of Sync, this happened.
• Now, when chef made 1 burger, customer didn’t turn up. Chef continues to make burgers until the 10 burgers are ready! But as per our scenario 2, the customer is awakened when the burger==1; but here burgers gets incremented by the Chef; so burger never will be equal to one and Customer goes into infinite sleep. This condition isn’t acceptable right?
You need to solve this problem that no one gets infinite sleep and chef serves the customer properly without any wait.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:00, banna01man
You need a reliable network for about twenty-five computers that will be distributed across a large building. it is important that the network be relatively cheap. which topology should you use?
Answers: 1
image
Computers and Technology, 22.06.2019 17:50, ImBADatmath8743
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
image
Computers and Technology, 22.06.2019 18:00, deathfire5866
Determine whether the following careers would require training or college.
Answers: 1
image
Computers and Technology, 22.06.2019 21:30, Tcareyoliver
The salespeople at hyperactive media sales all use laptop computers so they can take data with them on the road. you are a salesperson for superduper lightspeed computers talking to hyperactive media sales about upgrading the laptops to windows 10. explain how network location awareness in windows 10 would make the laptops more secure.
Answers: 3
Do you know the correct answer?
Kindly help me in this question by C PROGRAM or BY WORDINGS WHICH DESCRIBES THE PROBLEM SOLUTION Su...

Questions in other subjects:

Konu
Mathematics, 15.06.2021 16:20
Konu
Mathematics, 15.06.2021 16:20