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 thrashing, What is thrashing? It is a method in virtual memory...

What is thrashing? It is a method in virtual memory schemes when the processor spends most of its time swapping pages, rather than implementing instructions. This is because o

Define the global vs. local variables, Define the Global vs. local variable...

Define the Global vs. local variables It is also important to discuss the scope of resources being granted to the application program.  Variable scoping is defined as the acces

Problem, whats the problem in two state model ?

whats the problem in two state model ?

Under what circumstances do page faults occur, Under what circumstances do ...

Under what circumstances do page faults occur?  Describe the actions taken by the operating system when a page fault occurs. A page fault happens when an access to a page that

Programable clock modes in computer systems, Ask question #Minimuexplain th...

Ask question #Minimuexplain the programable clock modes in a computer system m 100 words accepted#

Write a short note on file organization and access, Write a short note on f...

Write a short note on file organization and access. There are three methods to access files 1Record Access 2Sequential Access 3Random Access The record access

What happens when you high-level format a floppy disk, Question: a. The...

Question: a. The following questions refer to a generic Windows file system: i) Describe what happens when you high-level format a floppy disk? ii) What is the maximum size

Operating system strectures, with the aid of diagrams describe the followin...

with the aid of diagrams describe the following os structures monolithic , layered, client server

Ipc, Explain in detail about ipc in linux

Explain in detail about ipc in linux

System structures, advantages and disadvantages of monolithic and layered a...

advantages and disadvantages of monolithic and layered approach

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