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

First order predicate logic - artificial intelligence, First Order Predicat...

First Order Predicate Logic : This is a more expressive logic because it is mostly builds on propositional logic by allowing us to needs as constants, variables, predicates,

Executing a parallel algorithm, Q. Executing a parallel algorithm? Mult...

Q. Executing a parallel algorithm? Multiple processors need synchronization with one another when executing a parallel algorithm. So task which is running on processor X may ha

Performance instrumentation in parallel computer, Performance instrumentati...

Performance instrumentation focuses on how to resourcefully collect information about computation of parallel computer. Method of instrumentation mostly tries to capture informatio

Break keys, Like a normal read, your input should break on the new line cha...

Like a normal read, your input should break on the new line character "\n"   and also on the up and down arrow keys. You will process the input made by the user when he/she enters

Advantages and disadvantage of message passage programming, Q. Advantages a...

Q. Advantages and Disadvantage of Message Passage Programming? Advantages of Message Passage Programming     Portable It is less error prone Offers excellent

What are single stage and multistage networks, What are single stage and mu...

What are single stage and multistage networks? Compare the strengths and weaknesses of each. OR List the major difference in single stage, two stages and three stage Netw

Define process of instruction execution, Instruction execution is performed...

Instruction execution is performed in CPU registers. Although before we define process of instruction execution let's first give details on Registers (temporary storage location in

Convert the following into sop form, Q. Convert the following into SOP form...

Q. Convert the following into SOP form   1. (A+B) (B'+C) (A'+ C) 2. (A+C) (AB'+AC) (A'C'+B) 3. (A'+B') (C'+B)   Q.Convert the following into POS form   1. WYZ + XYZ + W'X'

Illustrate logical data processing instructions, Q. Illustrate logical Data...

Q. Illustrate logical Data Processing Instructions? AND, OR, NOT, XOR operate on binary data stored in registers. For illustration if two registers comprises data:   R1 = 10

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