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

  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:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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