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

Introduce new game machine with new finish to attract

Dragon Games Inc wants to introduce a new game machine with a new finish to attract the young players. Set up to refinish the old boxes at a cost of $800. This will result in

Differences in a given respect are relevant for the aims

Feinberg states the Fair Opportunity Requirement as follows. "Differences in a given respect are relevant for the aims of distributive justice, only if they are differences fo

Provide an example of business problem

Provide an example of a business problem that could be solved by using queuing theory. In your post, specify what the problem is that you’d like to solve and how you would spe

Is the document visually inviting

Aziza is applying to various colleges and is required to write an essay about her ambitions for each college. After spending weeks on the essay, she has finally completed it.

Greater fraction of beta corp stock price

Alpha Corp's earnings and dividends are growing at 15% per year. Beta Corp's earnings and dividends are growing at 8% per year. The companies' assets, earnings, and dividend

Improve logistics in order to increase profitability

Imagine that you are a manager at a brick and mortar store that has an online storefront as an additional source of revenue. The company has tasked you with creating ideas to

Firm is using sales and operations planning

If a firm is using sales and operations planning (S&OP) to coordinate marketing and operations, does it need master planning such as ERP or ERP2? How are S&OP and master plann

Companies want to make the best marketing decisions

Companies want to make the best marketing decisions possible regarding which customers to pursue, which products or services to introduce or promote, where to sell their produ

Reviews

Write a Review

 
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