![summerkilby8](/avatars/47472.jpg)
summerkilby8
14.04.2021 •
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.
Solved
Show answers
More tips
- C Computers and Internet What to Do If Your ICQ Gets Hacked?...
- L Leisure and Entertainment How to Land on the Moon: Your Comprehensive Guide...
- T Travel and tourism How to Use a Compass: A Beginner s Guide...
- C Computers and Internet Porn Banner: What It Is and How to Get Rid Of It?...
- C Computers and Internet Отправляем смс через интернет: легко и просто...
- L Leisure and Entertainment The Best Film of 2010: A Look Back at the Academy Awards...
- H Health and Medicine Simple and Effective: How to Get Rid of Cracked Heels...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
- L Leisure and Entertainment History of International Women s Day: When Did the Celebration of March 8th Begin?...
Answers on questions: Computers and Technology
- C Computers and Technology How many tables are needed to implement an REA data model that has five distinct entity-sets, two many-to-many relationships and three one-to-many relationships in a...
- C Computers and Technology blender include smart names that provide useful auto-generated mini folding tables to Bones true or false...
- B Biology Once transcribed, eukaryotic mRNA typically undergoes substantial alteration that includes (a) union with ribosome (b) excision of introns (c) fusion into circular...
- M Mathematics A wheat farmer averaged 44 bushels of wheat per acre for the current harvest. This is 80% of last year s crop. Find the average number of bushels of wheat per acre obtained...
- M Mathematics ( 6 x 10^-8) / (1.5 x 10^-9)...
- M Mathematics Describe the five definitions for the nature of roots of quadratic equation and give the condition for each nature...
- M Mathematics 3.3.PS-15 0 Question Help Think About the Process There are 4,800 books in the town s library. Of these, 3,600 are fiction. To find the percent of the books that are...
- E English Which dark solar feature is shown in the picture above? Solar flare Prominence Sunspot Corona...
- P Physics A red block (mr=2kg) is released from rest and slides down a slope. At the bottom it collided with a blue block (mb=0.5kg). They stick together after the collision. a)...
- B Biology The chemical subunits called acids are joined together to form proteins....
Ответ:
First of all you need to put it in shorter terms
Explanation:
Ответ:
o???