BARBER SHOP PROBLEM, Operating System

Assignment Help:
a) The barber shop has one barber, one barber chair, and n chairs for waiting customers, to sit on. If there are no customers present, the barber sits down in the barber chair and falls asleep, as illustrated in Fig.1. When a customer arrives, he has to wake up the sleeping barber. If additional customers arrive while the barber is cutting a customer''s hair, they either sit down (if there are empty chairs) or leave the shop (if all chairs are full). Program the barber and the customers without getting into race conditions using C++ or Java program.

Fig. 1: Sleeping Barber

Related Discussions:- BARBER SHOP PROBLEM

What is an acyclic graph, What is an acyclic graph? A tree that has bee...

What is an acyclic graph? A tree that has been corrupted by links to other branches, but does not have any cyclic paths in it.

How can the index blocks be implemented, How can the index blocks be implem...

How can the index blocks be implemented in the indexed allocation scheme? The index block can be implemented as follows a. Multilevel scheme b. Linked scheme c. Combin

Command interpreters, Develop a user mode command interpreter which support...

Develop a user mode command interpreter which support these functions: "list-short" -- just like ls without any options "list-long" -- same as ls -l "change" -- same as cd Your co

What is a dispatcher, What is a Dispatcher? The dispatcher is the modul...

What is a Dispatcher? The dispatcher is the module that gives control of the CPU to the process selected by the short- term scheduler. This function includes: Switching

State in a deadlock-avoidance system, Question: In a deadlock, processe...

Question: In a deadlock, processes never finish executing and system resources are tied up, preventing other jobs from starting. Deadlocks can be characterised by a set of cond

What are the different methods for handling deadlocks?, What are the differ...

What are the different methods for handling deadlocks? Deadlock detection and recovery: Permit the system to enter a deadlock state, detect it and after that rec

Why do systems store the operating system in firm ware, Q. Why do several s...

Q. Why do several systems store the operating system in firm ware and others on disk? Answer: For certain devices such like handheld PDAs and cellular telephones a disk with

What are the disadvantages of linked allocation, What are the disadvantages...

What are the disadvantages of linked allocation? The drawbacks are a. Used only for sequential access of files. b. Direct access is not supported c. Memory space neede

How file record length should be chosen, How File record length should be c...

How File record length should be chosen File record length should be selected to match the data characteristics

Explain page-replacement algorithms, Q. Consider the following page-replac...

Q. Consider the following page-replacement algorithms. Rank the algorithms on a five-point scale from "bad" to "perfect" according to their page-fault rate. Detach those algorithm

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd