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 should he input for the seasonal factors

Unfortunately, Herman has not kept any historical data, but he estimates that first- quarter demand for the lights is about 30 percent below average, the second quarter demand about 20 percent below average, third-quarter demand about average, and..

  Calculate the standard deviation of the return on

Calculate the percentage return on the security in one year is $1000, $1500,$2000, or $2500. (note: this is the total amount returned to the investor, so you may just calculate the total return and not worry about how this is split up between curr..

  Describe the organizational situations that support

Describe the organizational situations that support each of the three types of system-wide process interventions: (1) the organization confrontation meeting, (2) the intergroup relations intervention, and (3) the large group intervention.

  What would they have to learn elsewhere

What kinds of information do you think recruiters can legitimately expect to learn on a social networking site? What would they have to learn elsewhere?

  Describe the type of information that needs to be exchanged

Describe the type of information that needs to be exchanged between the partners in each pair of partners. What 15 each organization looking for in its information systems?

  What is the upside for michelle foster if ncy succeeds

What is the upside for Michelle Foster if NCY succeeds? What are the professional risks she faces? (New venture creation capter7 Preparation questions)

  Discussion on rapid reflection model

What is your opinion on the Rapid Reflection model? Do you believe it could be implemented in today's hectic corporate world? Elaborate.

  How is a project baseline used to guide the execution

How is a project baseline used to guide the execution of the project's work, to evaluate progress and performance, and to control the project?

  Create a fictional mne which manufactures imaginary product

Create a fictional MNE which manufactures an imaginary product and choose a country in which to conduct FDI. Describe your MNE with a brief business plan. Examine the benefits and costs of FDI to the home and host countries. Describe the MNE's fut..

  Describe why the program was eventually dissolved

Why are unions exploring new collaboration solutions in the face of economic/work adversity, and how did Saturn's ambitious Quality of Work Life (QWL) program address these factors? In addition, describe why the program was eventually dissolved.

  Discuss the reasons for such high failure rates

Discuss the reasons for such high failure rates, suggest ways to avoid such failures and if the system is not operating up to expectations, should it be replaced?

  The dilemma of an inactive business line

"Managers at iGlobal, an IT solutions company, are faced with the dilemma of an inactive business line. The product line was launched seven years back but it could not respond to changing demands and trends

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