subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:00
How is the number 110 written when expanded out to place values in the base 2 (binary) number system? options: 2 x 4 + 3 x 2 + 4 x 1 1 x 2 + 1 x 2 + 0 x 2 1 x 100 + 1 x 10 + 0 x 1 1 x 4 + 1 x 2 + 0 x 1
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 22.06.2019 21:30
This graph compares the total cost of attending educational institutions in texas. the graph demonstrates that the cost at private and public technical schools greatly varies.
Answers: 2
question
Computers and Technology, 23.06.2019 00:10
Write a function so that the main0 code below can be replaced by the simpler code that calls function mphandminutes tomiles0. original main0 int main) l double milesperhour-70.0; double minutestraveled = 100.0; double hourstraveled; double milestraveled; hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; cout < "miles" 2 using namespace std; 4 /* your solution goes here/ 6 int maino 1 test passed 7 double milesperhour 70.0 all tests passed 8 double minutestraveled 100.0; 10 cout < < "miles: " < < mphandminutestomiles(milesper-hour, minutestraveled) < < endl; 12 return 0; 13
Answers: 1
You know the right answer?
Kindly help me in this question by C PROGRAM or BY WORDINGS WHICH DESCRIBES THE PROBLEM SOLUTION Su...
Questions
question
Mathematics, 14.02.2020 01:15
question
Mathematics, 14.02.2020 01:15
question
Mathematics, 14.02.2020 01:15