Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

With the given system state, analyze that the request P2(2,1,2)could be granted

ID: 3608012 • Letter: W

Question

With the given system state, analyze that the request P2(2,1,2)could be granted or not while using Banker’s Algorithm?

Run the safety algorithm on the given system state and find theSafe Sequence. Show step by step procedure to construct a safesequence. And if it is not possible to construct a Safe sequencethen point out the position where the Safety algorithm getsstuck.

Allocation

Max

Available

A

B

C

A

B

C

A

B

C

P0

5

8

2

8

10

5

2

3

2

P1

3

0

1

5

1

2

P2

2

4

2

4

6

4

P3

0

1

1

1

1

1

P4

2

4

0

5

7

0

Allocation

Max

Available

A

B

C

A

B

C

A

B

C

P0

5

8

2

8

10

5

2

3

2

P1

3

0

1

5

1

2

P2

2

4

2

4

6

4

P3

0

1

1

1

1

1

P4

2

4

0

5

7

0

Explanation / Answer

//Hope this will helpyou.. //Don't forget to ratethis..


Dear,
this can be find byallocating P2(2,1,2) and then find thenapplying the banker's algo and find the safe sequence exists ornot.

if weallocate (2,1,2) to P2 , then the different matrix willbe

Available =   0 2 0
Maximum Requirement =   8 10 5   5 1 2   4 6 4   1 1 1   5 7 0

Allocation =   5 8 2   3 0 1   4 5 4   0 1 1   2 4 0

Need =   3 2 3   2 1 1   0 1 0   1 0 0   3 3 0

process P2 can be completed ( Need of P2 <Available) So after completing it's task it will free it's allresource so Available= 4 7 4

process P0 can be completed ( Need of P0 <Available) So after completing it's task it will free it's allresource so Available= 9 15 6

process P1 can be completed ( Need of P1 <Available) So after completing it's task it will free it's allresource so Available= 12 15 7

process P3 can be completed ( Need of P3 <Available) So after completing it's task it will free it's allresource so Available= 12 16 8

process P4 can be completed ( Need of P4 <Available) So after completing it's task it will free it's allresource so Available= 14 20 8





so we can see that P2-> P0 -> P1 -> P3 ->P4, so this request will be granted.




//Hope this will helpyou.. //Don't forget to ratethis..


Dear,
this can be find byallocating P2(2,1,2) and then find thenapplying the banker's algo and find the safe sequence exists ornot.

if weallocate (2,1,2) to P2 , then the different matrix willbe

Available =   0 2 0
Maximum Requirement =   8 10 5   5 1 2   4 6 4   1 1 1   5 7 0

Allocation =   5 8 2   3 0 1   4 5 4   0 1 1   2 4 0

Need =   3 2 3   2 1 1   0 1 0   1 0 0   3 3 0

process P2 can be completed ( Need of P2 <Available) So after completing it's task it will free it's allresource so Available= 4 7 4

process P0 can be completed ( Need of P0 <Available) So after completing it's task it will free it's allresource so Available= 9 15 6

process P1 can be completed ( Need of P1 <Available) So after completing it's task it will free it's allresource so Available= 12 15 7

process P3 can be completed ( Need of P3 <Available) So after completing it's task it will free it's allresource so Available= 12 16 8

process P4 can be completed ( Need of P4 <Available) So after completing it's task it will free it's allresource so Available= 14 20 8





so we can see that P2-> P0 -> P1 -> P3 ->P4, so this request will be granted.




Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote