Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SUBJECT: OPERATING SYSTEMS SLEEPING BARBER PROBLEM In computer science, the sleeping barber problem is a classic inter-process that can be found in the operating systems.

SUBJECT: OPERATING SYSTEMS

SLEEPING BARBER PROBLEM

In computer science, the sleeping barber problem is a classic inter-process that can be found in the operating systems. The problem is analogous to that of keeping a barber working when there are customers, resting when there are none, and doing so in an orderly manner. This case is instructive because the problems encountered when attempting to provide tailored access to barbershop resources are like those encountered in a real operating system.

The analogy is based upon a hypothetical barber shop with one barber. The barber has one barber chair and a waiting room with three of chairs in it. When the barber finishes cutting a customer's hair, he dismisses the customer (after getting the payment at the cash register) and go back to the waiting room to see if there are other customers waiting. If there are customers, he brings one of customer back to the chair and cut his hair. If there are no other customers waiting, barber returns to sleep at the Backoffice. He will wake up when the newly arrived customer rings the bell (the call form the arrived customer). The barber spends 15 minutes to get ready and then barber will go to waiting room to pick up customer and then go to the Chair, with the customer. At the chair barber will be serving to the customer (basically cutting the hair based on customer needs /desire). When the job done, barber will bring the customer to the cash register. It takes 15 minutes to process the payment. At the cash register barber will collect the payment from the customer and then will let customer exit. Then barber will go back to the waiting room. If there are no other customers waiting, barber returns to sleep at the Backoffice. The barber must divide his time among cutting hair, accepting payment, and sleeping while waiting for a customer.

When a customer arrives to the shop, he enters the waiting room where there are only three chairs for the customers to sit and wait. If there is a free chair in the waiting room, the customer sits in it and waits for his turn. If there is no free chair, the customer leaves/exit. If there are no more customer before the newly arrived customer, and customer will sit and then ring the bell to call the barber. If the barber not shows up then customer will exit. If there is not seating space in the waiting room then customer will exit. If there is seating space in the waiting room, then customer will have seat and wait. If there are no more customer before the customer, and then customer rings the bell and If barber not showed up then exit. When the barber comes, then go to the chair with him. Customer stays at chair till the barber does his job (cut the hair). Then go to the cash register and pay the money and Exit.

BABER SHOP SERVICE DURATIONS

Buzzcut 60 minutes

Regular Haircut 90 minutes

Hot Towel Shave 120 minutes

Haircut and Beardtrim 150 minutes

ON THE DAY OF THE SERVICE

Regular business hours 8:00 5:00PM ( no lunch break)

Customer A who wants Regular Haircut arrives at 8:30AM and must exit at 11:00AM

Customer B who wants Haircut and Beardtrim arrived at 10:00AM and must exit at 2:00PM

Customer C who wants Buzzcut arrived at 10:30AM and must exit at 3:00PM

Customer D who wants Hot Towel Shave arrived at 3:45PM and must exit at when store closed at 5:00PM.

Customer E who wants Haircut and Beardtrim arrived at 10:15AM and must exit at 12:30PM

QUESTION1 - Explain the given system (sleeping barber problem is a classic inter-process that can be found in the operating systems ) and its main parameters?

CONCLUSION -

QUESTION - Provide report on the customers about the process they received. Which one had his hair done?And which one not?

Explain the cases where barber goes to sleep..And, provide the total sleep time. What can be done to have all customer get the service (Hair Cut)?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago