Determine resources, need matrix using banker's algorithm, Computer Engineering

Assignment Help:

Consider the following system snapshot using data structures in the Banker's algorithm, with resources A, B, C, and D, and process P0 to P4:

                          Max                             Allocation                        Need                             Available

 

P0

A

6

B

0

C

1

D

2

A

4

B

0

C

0

D

1

A    B   C   D

A

B

C   D

P1

1

7

5

0

1

1

0

0

 

 

 

 

P2

2

3

5

6

1

2

5

4

 

 

 

 

P3

1

6

5

3

0

6

3

3

 

 

 

 

P4

1

6

5

6

0

2

1

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3

2

1    1

Using Banker's algorithm, answer the following questions.

(a)   How many resources of type A, B, C, and D are there?

(b)   What are the contents of the Need matrix?

(c)   Is the system in a safe state? Why

(d)  If a request from process P4 arrives for additional resources of (1,2,0,0,), can  the  Banker's  algorithm  grant  the  request  immediately? Show the new system state and other criteria.

(a) Resources of type A, B, C, and D are as: A-9; B-13;C-10;D-11

(b) Need[i, j]=Max[i,j]-Allocation[i,j] therefore content of Need matrix is

            A          B          C          D

P0        2          0          1          1

P1        0          6          5          0

P2        1          1          0          2

P3        1          0          2          0

P4        1          4          4          4

(c)  The  system  is  in  a  safe  state  like  the  processes  can  be  complete  in  the sequence P0, P2, P4, P1 and P3.

(d) If a request from process P4 attains for additional resources of (1,2,0,0,), and if such request is granted so the new system state would be in tabulated form asfollows.

                  Max                    Allocation              Need                         Available

             A   B   C    D        A   B   C   D              A   B    C    D               A   B   C   D

P0        6    0    1    2         4    0    0    1          2    0    1    1

P1        1    7    5    0         1    1    0    0          0    6    5    0

P2        2    3    5    6         1    2    5    4          1    1    0    2

P3        1    6    5    3         0    6    3    3          1    0    2    0

P4        1    6    5    6         1    4    1    2          0    2    4    4

2    0    1    1

After PO finishes P3 can be assigned. 1020 from released 6012 and also available 2011(Total 80 23) and is a safe sequence.


Related Discussions:- Determine resources, need matrix using banker's algorithm

Explain the working of a half subtractor, With the help of a truth table ex...

With the help of a truth table explain the working of a half subtractor. Draw the logic diagram using gates. Ans: Half Subtractor: For the subtraction of B (subtrahend) f

Write short note on code optimization, Write short note on code optimizatio...

Write short note on code optimization. Code optimization: It is the optional phase designed to enhance the intermediate code therefore the Ultimate object program runs quicke

Mathematical simulation and modeling applications, Mathematical Simulation ...

Mathematical Simulation and Modeling Applications The tasks including modeling and mathematical simulation require a lot of parallel processing. Three basic formalisms in model

Translator for low level programming language, Translator for low level pro...

Translator for low level programming language were termed as? Ans. Translator for low level programming language is called as Assembler.

One pointer variable be subtracted from another, Under what conditions can ...

Under what conditions can one pointer variable be subtracted from another? Pointer subtraction isn't used very much, but can be handy to determine the distances between two arr

What is redundant array of independent disks, What is Redundant Array of In...

What is Redundant Array of Independent Disks? Researchers are constantly trying to improve secondary storage media by raising their, performance, capacity as well as reliabilit

Evaluate fixed execution time, The statement of Gustafson's law can be desc...

The statement of Gustafson's law can be described with the help of an illustration. Let us take a problem, say P, which has to be solved using a parallel computer. Let Ts be the ti

What are the main features of uml, What are the main features of UML ...

What are the main features of UML Defined system structure for the object modelling Support for all different model organization Strong modelling for behaviour an

Explain about the links and association, Links and Association Links a...

Links and Association Links and associations are the basic means used for establishing relationships among objects and classes of the system. In the next subsection we will di

Chemistry, what are the applications of photochemistry?

what are the applications of photochemistry?

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