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

Operation managmant, what is the function of operation management?

what is the function of operation management?

Explain general graph directory, General graph directory The serious pr...

General graph directory The serious problem with using an acyclic-graph structure is ensuring that there are no cycles. When we insert links to an existing tree-structured dire

Explanation of modern cpu architectures, Your CTO liked your proposal from ...

Your CTO liked your proposal from Unit 2 so much he only trusts you to explain complex concepts to his managers. He now wants you to write him a four page paper explaining the CPU,

How can the deadlock be prevented-bankers algorithm, How can the deadlock b...

How can the deadlock be prevented Bankers algorithm : The Resource allocation graph algorithm isn't applicable to a resource allocation system with multiple instances of every

Synchronization, As we already know, threadsmust ensure consistency; otherw...

As we already know, threadsmust ensure consistency; otherwise, race conditions (non-deterministic results) might happen. Now consider the "too much milk problem": two people share

What is the drawbacks of contiguous allocation of disk space, What are the ...

What are the drawbacks of contiguous allocation of disk space? The disadvantages are a. Suffers from internal fragmentation b. Suffers from external fragmentation c. F

What are the various categories of software, What are the various categorie...

What are the various categories of software?  System software Application  software Engineering/Scientific software Embedded software  Web Applications Artificial I

Explain drawbacks of fixed partitioning, The drawbacks of fixed partitionin...

The drawbacks of fixed partitioning are: The number of partitions are précised at system generation time limits the number of active processes in the system. For the re

Explain segmentation hardware?, Explain segmentation hardware? We defin...

Explain segmentation hardware? We define an completion to map two-dimensional user-defined addresses into one-dimensional physical addresses. This mapping is affected by means

Most wans utilize only a partially connected topology, Q. Most WANs utilize...

Q. Most WANs utilize only a partially connected topology. Why is this subsequently Answer: Cost. A completely connected network requires a link between every node in the netw

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