Individual turn around time and the average turnaround time

Assignment Help C/C++ Programming
Reference no: EM133119209

Question:

Create a Deadlock Prevention program that submits processes to the Ready State only if they can be allocated all of the devices they request for execution. The server has a list of total resources, such as scanner, laser printer, and 3-D printer and a total number of devices for each. A client is prompted to enter a given device (for example "S", "L" or "D") and the number of instances of that device needed. Such a request is sent to the server by several clients. If the full request for devices cannot be allocated for this client, none of the devices will be allocated and the client request is rejected with a message back to the client. If the full request for devices can be satisfied, this client is allowed to be placed in the Ready State. Use appropriate print statements to indicate whether or not device requests are satisfied, thus allocated. When at least 3 clients have been added successfully to the Ready state, the server "runs" the client processes that are in the Ready State (by adding the CPU burst to a "clock"). As each process completes, its resources will be deallocated and added back to the available resources. Show the initial list of resources, the available resources after they have been allocated for each client, and the final list of resources when a process completes. Report to each client its individual turn around time and the average turnaround time for all client processes.

Assume that all processes arrive at time 0. Format your output to one place after the decimal.

For example:

Total Devices: 5 scanners, 3 laser printers, 6 3_D Message on server: S5 L3 D6 available
printers

Request from client1: S2, L0, D3, cpu burst 22 Message on server: S2L0D3 allocated
Message on server: S3L3 D3 available

Request from client2: S1, L2, D2, cpu burst 17 Message on server: S1L2D2allocated
Message on server: S2 L1 D1 available

Request from client3: S3, L1, D1, cpu burst 33 Message on server: S2 L1 D1rejected
Message from server to client 3: not enough resources

Request from client4: S1, L1, D1, cpu burst 8 Message on server: S1L1D1 allocated
Message on server: S1 L0 D0 available

Client programs are now in Ready and have been allocated resources...

Returned to client1 from server: 22 (turnaround time), 15.7 (average turnaround time)
Message on server: S3 L0D3 available

Returned to client2 from server: 39 (turnaround time), 15.7 (average turnaround time)
Message on server: S4 L2 D5 available

Returned to client4 from server: 47 (turnaround time), 15.7 (average turnaround time)
Message on server: S5 L3 D6 available

Please note: My messages have been abbreviated to fit on the page. Your output can be more descriptive.

Reference no: EM133119209

Questions Cloud

How is ownership to blackacre held after bob and carol die : Aaron, Bob and Carol purchased Blackacre and own the property as joint tenants with the right of survivorship. Aaron owns 40%. Bob and Carol own 30% each.
Sleeping on the job : Should the company's treatment of the grievant for the first two "sleeping on the job" incidents influence the outcome in this case? Explain.
What was the quantity produced and the price per toy : We have been asked to analyze our toy products by price (from $10.00 to $13.00 by 0.25). When the profit = $1,210, what was the quantity produced and the price
Best estimate of the current stock price : The XYZ paid $1.15 dividend yesterday. It's growth rate is expected to be constant at 21.10% for 2 years, after which dividends are expected to grow at a rate o
Individual turn around time and the average turnaround time : Report to each client its individual turn around time and the average turnaround time for all client processes
What is the theta of the option as the expiration time : What is the theta of the option as the expiration time declines from 60 to 50 days? Answer to 2 decimal places.
Why the elevator speech is important : Why the elevator speech is important and how it will help you prepare for recruiting events, interviews, and a career in the accounting profession
What will be the return on the portfolio a : Assume that a three-factor APT describes the returns of all well-diversified portfolios, and that the three factors are unexpected changes in production (factor
Determine the return on stockholders equity : Average common stockholders' equity 1,465,263. Determine (a) the return on stockholders' equity and (b) the return on common stockholders' equity

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create shoutbox class for your virtual world.

The shoutOutRandomMessage() method will use a random number generator that selects one word from each data structure to form a random message

  Write a only the client program

If the command is ADD then the details roll number and name will be added to a file. After adding the current request the file is sent back to the client. Write a only the client program.

  Write a program that requests the day the month and the year

Write a program that requests the day, the month and the year. Write a program that requests a major and college using the cin command.

  Create a class called geometrycalculator.

compute the volume and surface area of a sphere with radius r, a cylinder with circular base with radius r and height h, and a cone with circular base with radius r and height h.

  CSE1321L Programming and Problem Solving Assignment Problem

CSE 1321L Programming and Problem Solving I Lab Assignment help and solution, Assessment help - Write a nested loop that asks the user for symbol

  Program of public class tempconverter

There are numerous opportunities for errors in any program, many times in places that seem too simple to require close attention.

  Compcets of office apps

Cell Reference is the location of a cell. Cells are located in columns marked by letters, and rows are marked by numbers. Example to reference a cell in column D row 10 you would reference it as D10.

  What is the c++ statement responsible for the output display

What is the C++ statement responsible for the output display and add the new display statement to the existing program requesting ENTER EMPLOYEE ID. Compile and run your program.

  Write a main function to test the class employee

Define an Employee class. Add the following private date members to the class: string status, int dependents. Status represents the marital status of the employee and should be set to either "m" or "s".

  Create program that read numbers from cin and then sums them

Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered. Construct three versions of this program, using the while, do - while , and for loops.

  Implement a class which uses a vector to store the queue

Implement a class which uses a vector to store the queue. Be mindful of performance, such that if the queue is empty, the size of the underlying vector is "rese

  What is special about the point where cp is a maximum

what position along the chord does the minimum pressure occur - what is special about the point where Cp is a maximum?

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