In this assignment you will implement a deadlock avoidance

Assignment Help Operating System
Reference no: EM13347867

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 shortest computation time (SJF) to be serviced. 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 shortest computation time is chosen for service. Ties are broken arbitrarily. 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 LLF (least laxity rst scheduling) instead of SJF. The deadlock-handling process chooses the next process with the least laxity (slack) to be serviced. Laxity (l) is de ned as deadline (d) minus remaining computation time (c) at a speci c time (t), that is, l(t) = d(t) - c(t). Which scheduling technique yields fewer deadline misses

Reference no: EM13347867

Questions Cloud

Question 1 the volume of a pyramid is taken from the : question 1 the volume of a pyramid is taken from the formula v 13 x area of base x altitudegiven the dimensions of a
Question 1 explain the role of the following three bodies : question 1. explain the role of the following three bodies in national health reform and the implementation of activity
1 analze the german fdi before financial crisis and after : 1 analze the german fdi before financial crisis and after financial crisisreferencing style apa2 germanys future
The aim of this module is to explore leadership theory and : the aim of this module is to explore leadership theory and practice in relation to theories and processes of innovation
In this assignment you will implement a deadlock avoidance : in this assignment you will implement a deadlock avoidance algorithm as part of the process manager to avoid deadlocks
Assignment risk return and capital asset pricing model : assignment risk return and capital asset pricing model problemsin this assignment assume that you are nearing
1 the four common isotopes of sulfur have atomic masses of : 1 the four common isotopes of sulfur have atomic masses of 32 33 34 and 35 amu respectively. draw valence diagrams of
Show items considered capital expenditures for the new : show items considered capital expenditures for the new business startup.do research to evaluates costs of these capital
Project title computer sales and repair store system - : project title computer sales and repair store system - csrssit is required to design a relational database system for a

Reviews

Write a Review

Operating System Questions & Answers

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

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