Write a program (c or c++) to synchronize the barber

Assignment Help Basic Computer Science
Reference no: EM131039909

The Sleeping Barber Problem is one of the classical IPC problems. The barber shop has one barber, one barber chair, and n chairs for waiting customers, if any, to sit on. If there are no customers present, the barber sits down in the barber chair and falls asleep. 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).
I would like you to write a program (C or C++) to synchronize the barber and the customers without getting into race conditions. You MUST use semaphores and your problem must be Object Oriented.

Reference no: EM131039909

Questions Cloud

Characteristics of process and outcome evaluation : Summarize the characteristics of process and outcome evaluation. Provide two examples of each type of evaluation. This is for a human service class so it has to be in an human service view point.
Payables in foreigncurrencies to insulate : The forward contract can hedge future receivables or payables in foreigncurrencies to insulate the firm against exchange rate risk. Yet, in this case, the KholCorporation should not hedge because it would benefit from appreciation of the pound whe..
Customer service representative for manufacturer of upscale : As a customer service representative for a manufacturer of upscale kitchen appliances, you're going to have to say no to Janet Hay's request for a refund. According to the handwritten note she included with the food processor that she just shipped ba..
Opportunity cost of producing : What happens If the market price of a good is more than the opportunity cost of producing it?
Write a program (c or c++) to synchronize the barber : I would like you to write a program (C or C++) to synchronize the barber and the customers without getting into race conditions. You MUST use semaphores and your problem must be Object Oriented.
Multinational firm providing parts for mobile devices : You work for Deerborn Electronics, a multinational firm providing parts for mobile devices. As the project manager for the tablet division, you have been kept extremely busy.
Factors impact the authors ability to influence audience : Authors (in either written or oral communication) who are trying to persuade an audience or argue a certain point may use fallacies to support the points being made. How does the author’s position, writing or speaking abilities, personality or other ..
What is the disability being discussed : What types of prejudice and discrimination has the person experienced - be as specific as possible. What impact has this had on the individual? How do your interviewee's experiences parallel or differ from what you have read and discussed about dis..
Fisher and ury approach for getting to yes : Discuss Fisher and Ury's approach for "Getting to Yes" and explain how you could apply it to a situation in your workplace?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write a class name payroll

Before asking the user for the hours, the program should set the pay rate for each employee without user input. Validation: Do not accept values greater than 60 for the number of hours worked.

  Edmonds-karp algorithm for finding the maximum flow

1. Edmonds-Karp algorithm for finding the maximum flow of O (NM 2 ) 2. Method push predpotoka finding maximum flow of O (N 4 ) 3. Modified method for pushing predpotoka O (N 3 ) 4. Feed restrictions 5. The flow of minimal cost (min-cost-flow). Algori..

  Describe what factors or variables contribute to a strong

The text emphasizes the need for strong business/IT relationships for managing IT. Describe what factors or variables contribute to a strong cross-unit relationship. Provide examples and cite your sources as appropriate.

  Centralized database management systems and distribute

Compare and contrast benefits and challenges that exist between centralized database management systems and distributed database management systems. Identify potential business environments where each can be properly used.

  Create an applet to draw a digit using the method

Create an applet to draw a digit using the method fillRect of the class Graphics. For instance, if the input is 4, the applet will display the digit 4. In java language please

  Processes for developing the client solution

As a consultant, you bring to the table standard methods and processes for developing the client solution. Your solution may be a general one with special emphasis on at least two TCOs addressed in the course.

  What server type would you most likely need to deploy

What server type would you most likely need to deploy at each physical location in a WAN?

  How to make sure that written work is free of grammar

How do you make sure that written work is free of grammar and spelling errors? Write down tools or secrets do you use?

  Program to keep track of the participants in a triathlon

Create a program to keep track of the participants in a triathlon. Your program will keep track of the times in three events: Running, Swimming, and Biking. Your program will calculate who is the winner in the Male category and the Female category..

  Network security assessment

You have been recently hired as a network security analyst for a small accounting firm. The firm is realizing that they need help to secure their network and customer's data. With your background and skills, they are looking to you to provide guid..

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Some nefarious computer activities called ping sweeps

Some nefarious computer activities called ping sweeps and port scans. He wants to know more about them and what their impact might be on the company.

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