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

  Compare and contrast the haiti sm discussion

Compare and contrast the Haiti SM discussion with the "Saving Lives with Social Media" case. Create a table that compares and contrasts elements from each.

  What are the factors influencing the development

what are the factors influencing the development of organizational ethis ?

  Some ideas on organizations and issues of concerns

some ideas on organizations and issues of concerns that I could use to complete my final project

  Determine number of families with children under age

Red Carpet Baby!, a children's accessory and toy store, uses U.S. Census information to determine number of families with children under age 5 in its market area.

  Forecast less average error and less average squared error

An analyst must decide between two different forecasting techniques for weekly sales of roller blades: a linear trend equation and the naive approach.

  Determine which sources of law would be most relevant

Determine which sources of law would be most relevant in this case and how management could leverage knowledge of those sources to prevent similar instances in the future.

  Discussion on aging issues

What new and distinctive challenges does the organization face regarding an aging workforce? What lessons have aging issues taught us in the past?

  Find out the optimal assignment of taxis to customers

The distances in miles from the waiting taxis to the customers are given in the subsequent table. Find out the optimal assignment of taxis to customers so as to minimize total driving distances to the customers.

  Describe how union pacific will be affected by each

Describe how Union Pacific will be affected by each of these external factors.

  Who is primarily responsible for which function

3) Discuss the difference between orientation and training. Who is primarily responsible for which function?

  Describe the make or buy option

How might a manager go about identifying the skills that the company will need in the future? Describe the "make or buy" option and how it can be applied to HR.

  Is there a particular type of group that uses a particular

Outline the positives and negatives of each approach. Is there a particular type of group that uses a particular leadership approach? Why do you think this is the case?

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