Java application using the java semaphore

Assignment Help Operating System
Reference no: EM13327908

Design and Programming Assignment

This is an open book assignment and you may use the course materials and peer reviewed sources. However, this excludes the use of any other people and all materials that are not peer reviewed. You must cite all references.

Description

For this problem you must use Java's semaphore class. Your implementation for this problem must only use the semaphore methods to control the concurrency of your solution (IE. acquire and release).

Consider a small take-out food restaurant called Burrito Brothers. This very popular establishment offers a VERY-TASTY burrito. There are three servers that own a private beef area, a cheese area, and a tortilla area (IE. Each server has their own ingredients in an infinite supply). Additionally there are three shared counter locations, a shared cash register and a shared waiting area that can accommodate up to 15 customers. By law the shop has a maximum customer capacity of 15.

A customer cannot enter the shop if it is filled to capacity. If the there is room a customer will gain access to the shop. Each customer will enter the shop with an order of one to 20 burritos. As soon as a server is free, the customer that has the shortest order is served next.

A server is either servicing a customer or waiting. Each server will make (at most) three burritos at time for a given customer. Once a server has obtained all ingredients, a burrito can be made. When a customer's entire order is finished, the customer pays a cashier and leaves the shop. Since there is only one cash register, only one patron may pay at a time. However, in the event that a customer's entire order has not been filled by the server at the completion of the current counter visit the customer must reenter the waiting area. The waiting area is organized by the shortest order next.

Implement a solution to this problem as a Java application using the Java semaphore class for synchronization. Your zip file must expand into a single directory and your application must compile at the command prompt using javac *.java. Output must include the arrival of each customer and each state transition: leaving full shop, entering shop with an order of m burritos, customer standing, getting service from server n, paying, and leaving. Each customer is represented by a corresponding thread and each server in your implementation is also represented by a unique Java thread. All customers and servers exist within a single application.

Reference no: EM13327908

Questions Cloud

Explain a lewis structure and non-zero formal charges : For each of the following polyatomic ions, provide a Lewis structure, including resonance if appropriate and all non-zero formal charges. A.) BH4- B.) HCO2- C.) AsCl4- D.) ICl2-
Law code of hammurabi and laws today : Describe what the Law Code of Hammurabi reveals about Babylonian culture; consider relations between men and women, slaves and freemen. Explain whether or not you believe that the punishments listed in the Law Code of Hammurabi “fit” the crimes. Iden..
What is the maximum acceleration the truck can have : A crate of mass 45.0 kg is being transported on the flatbed of a pickup truck. The truck accelerates forward on level ground. What is the maximum acceleration the truck can have
Start with the explanation of the analysis of two condition : Start with the explanation of the analysis of two conditions.
Java application using the java semaphore : Implementation for problem must only use the semaphore methods to control the concurrency of your solution - Implement a solution to this problem as a Java application using the Java semaphore
Find in what direction should the students head the boat : A group of students need to cross a river in the shortest time. In what direction should the students head the boat
Dry ground and clear skies : How quickly will temperature increase after sunrise as compared to the increase during a typical summer morning that begins with dry ground and clear skies?
Define what will the concentration be after 18.0 minutes : The rate constant for a certain reaction is = 6.10×10?3 . If the initial reactant concentration was 0.750 , what will the concentration be after 18.0 minutes
Explain four aspects of group behavior : 1.Explain four aspects of group behavior. How can each aspect help or hinder the group's functioning?

Reviews

Write a Review

Operating System Questions & Answers

  Draw curves for throughput-delay and power

Assume two hosts A and B are connected via router R. A-R link has infinite bandwidth; A-R link has infinite bandwidth; draw curves for throughput, delay, and power, each as function of load.

  Minimum and maximum size of an ethernet frame in bytes

Determine the minimum size and Maximum size of an Ethernet frame, in bytes?

  How many processes a computer can effectively support

Discuss the factors that you think would limit how many processes a computer can effectively support.

  A computer has a cache, main memory, and a disk

A computer has a cache, main memory, and a disk. If a referenced word is in the cache, 20 ns are required to access it. If it is in main memory but not in the cache (called cache miss)

  Differences between logical and physical security

With the help of analogy to explain the differences between logical and physical security to a nontechnical person.

  Computer privacy related question

One of the main concerns with the expanding influence of information technology is issue of personal privacy. As more and more individuals and businesses are using computers to transact business and store data the protection of individual privacy is ..

  Understanding networking concepts

Determine some of the issues facing AT&T as they try to integrate multiple services to deliver to the consumer? What impact does competition play?

  What operating system use to edit audio and video clips

Design and edit audio and video clips for school projects. What operating system must library consider for this facility? Explain why?

  Stateful inspection packet filtering routers

Name two benefits of Stateful Inspection Packet Filtering Routers. Name two benefits that firewalls add to a network

  Creating programs to compute

Compare zero-, one-, two-, and three-address machines through writing programs to compute X = (A+B X C)/D - E X F)

  Write the send and receive primitives for stated processes

Write the send and receive primitives for stated processes and processes can communicate with each other by name along with message. You need to Identify what type of IPC is this?

  Explain how to implement barriers using semaphores

Show how to implement barriers using semaphores. Your solution should avoid busy-waiting. Be explicit about any initializations that you need to assume.

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