Deadlock-handling process chooses the next process

Assignment Help Operation Management
Reference no: EM13334375

In this assignment, you will implement a deadlock avoidance algorithm as part of the process manager to avoid deadlocks in a Unix/Linux system. Part of the assignment requires the manipulation of Unix/Linux processes and part of it consists of simulation.

Both the deadlock-handling process and the processes requesting resources are real Unix/Linux processes created using fork(). However, you do not need to actually allocate any resource. The main process executes the Banker's algorithm. The resource-requesting processes make requests by communicating with the deadlock-handling process with either Unix/Linux pipes or shared memory controlled by semaphores (your choice, but pipes are easier to use).

The deadlock-handling process chooses the next process with the longest computation time (LJF) to be serviced. The rationale is that a long process should be executed earlier. Note that this is the opposite of shortest job first (SJF). After having one request serviced, a process has to allow another process to make a request before making another one, that is, another process with the longest computation time is chosen for service. Ties are broken in favor of the process with the nearest absolute deadline. A process can also release resources during its execution, and releases all resources held when it terminates.

Associated with each process is also a relative deadline (that is, the deadline from the current time instant). One time unit is needed for servicing each request (whether the resource is allocated or not), so the relative deadline for each process is decreased by 1 whether it is serviced or not. If the resource is allocated for a request, then the computation time of this process decreases by 1; otherwise, the computation time remains the same. If a process misses its deadline, keep servicing its requests but indicate the deadline miss in the output. A release instruction also needs 1 unit of computation time just like a request.

The input format is as follows:

m /* number of resources */

n /* number of processes */

available[1] = number of instances of resource 1

:

available[m] = number of instances of resource m

max[1,1] = maximum demand for resource 1 by process 1

:

max[n,m] = maximum demand for resource m by process n

process_1:

deadline_1 /* an integer, must be >= computation time */

computation_time_1 /* an integer, equal to number of requests and releases */

:

request(0,1,0,...,2) /* request vector, m integers */

:

release(0,1,0,...,1) /* release vector, m integers */

:

request(1,0,3,...,1) /* request vector, m integers */

:

end.

:

process_n:

deadline_n /* an integer */

computation_time_n /* an integer, equal to number of requests and releases */

:

request(0,2,0,...,2) /* request vector, m integers */

:

release(0,1,0,...,2) /* release vector, m integers */

:

request(1,0,3,...,1) /* request vector, m integers */

:

end.

For output, print the state of the system after servicing each request: the arrays available, allocation, need, and deadline misses, if any.

Next, let's try EDF (earliest deadline first scheduling) instead of LJF. The deadlock-handling process chooses the next process with the nearest absolute deadline to be serviced. Ties are broken in favor of the process with the longest execution time. Which scheduling technique yields fewer deadline misses?

Reference no: EM13334375

Questions Cloud

Determine what is the required rate of return on aas stock : AA Industries's stock has a beta of 0.8. The risk-free rare is 4% and the expected return on the market is 12%. What is the required rate of return on AA's stock
Explain multidimensional analysis : Give at least three reasons why ETL functions are most challenging in a data warehouse environment.
What does he mean by the veil of separation : Dubois writes of the "little world" in Tennessee, where he was a schoolteacher, and of the "'veil" separating the black community there from the rest of the nation. Why was he living in a "little world" and what does he mean by the "veil" of se..
Handle competitive pressures in private firms : Explain and critically discuss how human resource management can provide managers with solutions to handle competitive pressures in private firms
Deadlock-handling process chooses the next process : The deadlock-handling process chooses the next process with the nearest absolute deadline to be serviced. Ties are broken in favor of the process with the longest execution time. Which scheduling technique yields fewer deadline misses?
Estimation-forecasting-linear programming : Please describe ways in which two or more of the following techniques (Estimation, Forecasting, Linear Programming, and Econometrics) can be used together to solve a business problem, and please describe the nature of such a problem for which joint u..
Explain what volume in ml should be measured out : An experiment requires 42.5 g of sulfuric acid, which is easier to measure by volume than by mass. What volume in mL should be measured out, if the density of the sulfuric acid is 1.84 g/cm^3
What is the value of net domestic product : How does the income approach to measuring gdp differ from the expenditure approach? Explain the meaning of value added and it's importance in the income approach. Consider the following data for the selling price at each stage in the production of a ..
Estimate the magnetic field strength at the surface of bulb : Assume that a 7.0-cm-diameter, 50 W light bulb radiates all its energy as a single wavelength of visible light. Estimate the magnetic field strength at the surface of the bulb

Reviews

Write a Review

Operation Management Questions & Answers

  What is the system utilization

A single bay car wash with a Poisson arrival rate and an exponential service time has cars arriving an average of 10 minutes apart, and an average service time of four minutes.

  What are the forces for global convergence in a labor system

What are the forces for global convergence in a labor system? What are the forces for a labor system to maintain divergence or establish a divergent system?

  Determine resulting productivity ratio

The total output from a production system in one day is 900 units and the total labor necessary to produce the 900 units is 900 hours.

  Compute the capability index for the process

A process that produces computer chips has a mean of .04 defective chip and a standard deviation of .003 chip

  Define the term transfer of learning

A critical issue in training is the transfer of training, and ethics training is no exception. How could the transfer of ethics training back to the workplace be maximized? Define the term, transfer of learning.

  Illustrate what was poka-yoke shingo created

Existing method involved assemblers taking individual springs from a box containing several hundred also then placing two of m behind an ON button also two more behind an OFF button. Illustrate what was poka-yoke Shingo created

  Explain managerial styles to manage an emloyee

What are some managerial styles you would employ in managing an emloyee who is considered baby boomer.

  What should a firm do to promote voice in organizations

What should a firm do to promote voice in organizations, and why is this important in promoting organizational justice?

  Illustrate what forecasting techniques are available

As demand forecast is a key input for aggregate production planning, elucidate how can it be estimated by Bradford. Illustrate what forecasting techniques are available.

  Calculate the expected value of perfect information

Beverly has estimated that, during the 3 years of the lease, there is a 40% chance she will drive an average of 12,000 miles per year, a 30% chance she will drive an average of 15,000 miles per year, and a 30% chance that she will drive 18,000 mil..

  What is really being marketed

What is really being marketed (want satisfied), and who is the target market? 1. golf equipment 2. college textbook 3. beauty salon 4. mouthwash.

  How many toys must each restaurant order

How many toys must each restaurant order. How many toys should Burger King expect to have at the end of the promotion?

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