Write an algorithm for deadlock detection, Computer Engineering

Assignment Help:

Write an algorithm for deadlock detection.

An algorithm for deadlock detection:

1. Assume that Work and Finish be vectors of length m and n, correspondingly.

Initialize:

(a) Work = Available

(b) For i = 1,2, ..., n, if Allocation i ¹≠  0, then

Finish[i] = false; otherwise, Finish[i] = true.

2. Determine an index i such as both:

(a) Finish[i] == false

i.  (b)  Requesti ≤  Work

If no such i exists, go to step 4.

3.  Work = Work + Allocationi

Finish[i] = true go to step 2.

4. If Finish[i] == false, for some i, 1 ≤  i ≤  n, then the system is in deadlock state. Furthermore, if Finish[i] == false, then Pi is deadlocked.


Related Discussions:- Write an algorithm for deadlock detection

Which way do twin twist props on a boat rotate, Q. Which way do twin twist ...

Q. Which way do twin twist props on a boat rotate when propelling the boat forward? Answer:- In opposite direction however they are designed to propel the boat forward eve

Microprocessor, what is opcode for addition and subtraction

what is opcode for addition and subtraction

Modus ponens rule, Modus ponens rule: In fact the general format for t...

Modus ponens rule: In fact the general format for the modus ponens rule is as follows: like if we have a true sentence that states the proposition A implies proposition B and

Threads model - parallel programming model, In this model a one process can...

In this model a one process can have multiple, concurrent implementations paths. The major programs are scheduled to run by the native operating system. It loads and obtains all th

Explain the working principle of hard disk, Question : a) Hard disk is ...

Question : a) Hard disk is an important component of a computer. What type of memory is it? b) With the help of a diagram describe its features. c) Explain its working pr

Clocked sr flip flop, Clocked SR flip flop A clock pulse is a...

Clocked SR flip flop A clock pulse is a sequence of logic 0, logic 1, and logic 0 occuring on the CLK input. Time t n occurs before the clock pulse and time t n+1

Recursion to an iterative procedure, The data structure required to convert...

The data structure required to convert a recursion to an iterative procedure is  Stack is the data structure required to convert a recursion to an iterative procedure

What do you mean by perfect shuffle permutation, Q. What do you mean by Per...

Q. What do you mean by Perfect Shuffle Permutation? Perfect Shuffle Permutation: It was proposed by Harold Stone (1971). Consider N objects each is represented by n bit number

Define a formal system, Q. Define a Formal System? A Formal System is o...

Q. Define a Formal System? A Formal System is one which is planned in advance and is used according to schedule. In this system procedures and policies are documented well in a

Define realization of one flip flop using other flip flops, Define Realizat...

Define Realization of one flip flop using other flip flops? It is probable to implement a flip flop circuit using any other circuit. Universal block diagram is shown below.

Write Your Message!

Captcha
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