Hi, Please assist. Show all your work. Number clearly. Use chart in your work. 1
ID: 3860630 • Letter: H
Question
Hi,
Please assist.
Show all your work. Number clearly. Use chart in your work.
1.1 -Bankers Algorithm (Safety Algorithm)
Available Resource
Current Allocaton
Maximum Need
A B C
Need to Complete
A B C
A B C
2 3 1
A B C
P0
1 2 4
6 3 4
P1
1 0 0
6 5 3
P2
1 2 0
1 2 2
P3
2 1 1
3 5 2
P4
3 3 3
4 6 1
Fill in the Need to Complete column
Analyze whether there is a sequence that allows all processes to acquire resources and complete
If there is a sequence to complete list it here: Multiple, starts with P3, P2 either P0, P1
If there is no sequence to complete, explain why not
1.2 Disk Scheduling: using Shortest Seek-Time First, R/W head starts at track 50.
Sequence is 10, 50, 36, 21, 74, 28, 19, 35, 80, 72, 89, 20
Draw a line diagram with the track requests indicated like the powerpoint slide
Add arrows moving the R/W head to the next track using SSTF scheduling
Count the total head movement.
Available Resource
Current Allocaton
Maximum Need
A B C
Need to Complete
A B C
A B C
2 3 1
A B C
P0
1 2 4
6 3 4
P1
1 0 0
6 5 3
P2
1 2 0
1 2 2
P3
2 1 1
3 5 2
P4
3 3 3
4 6 1
Explanation / Answer
Bankers -Algorithm (Safety Algorithm)
Available Resource
Current Allocaton
Maximum Need
A B C
Need to Complete
A B C
A B C
2 3 1
A B C
P0
1 2 4
6 3 4
5 1 0
P1
1 0 0
6 5 3
5 5 3
P2
1 2 0
1 2 2
0 0 2
P3
2 1 1
3 5 2
1 4 1
P4
3 3 3
4 6 1
1 3 -2
yes, there is a sequence that allows all processes to acquire resources and complete
<P2,P3,P0,P1,P4>
P2 need is less than available , so it will execute first in the sequence , work = available + Alloc(P2) = <2 3 1> +
<1 2 0> = < 3 5 1>
P3 need is less than available , so it will execute in the sequence , work = available + Alloc(P3) = <3 5 1> +
<2 1 1> = < 5 6 2>
P0 need is less than available , so it will execute in the sequence , work = available + Alloc(P0) = <5 6 2> +
<1 2 4> = < 6 8 6>
P1 need is less than available , so it will execute in the sequence , work = available + Alloc(P1) = <6 8 6> +
<1 0 0> = < 7 8 6>
P4 need is less than available , so it will execute in the sequence , work = available + Alloc(P4) = <7 8 6> +
<3 3 3 > = < 10 11 9>
Total resources = <10 11 9>
5.1 B Disk Scheduling SSTF
Sequence is 10, 50, 36, 21, 74, 28, 19, 35, 80, 72, 89, 20
Start at track 50
10<----- 19<-20<-21<----28<----------35<-36<--------50
10-------------------------------->72-->74------------>80------------>89
50 - 36 = 14
36 - 35 = 1
35 - 28 = 7
28 - 21= 7
21 - 20 = 1
20 - 19 = 1
19 - 10 = 9
10 - 72 = 62
72-74 = 2
74-80 = 6
80-89 = 9
Total head movement = 119
Available Resource
Current Allocaton
Maximum Need
A B C
Need to Complete
A B C
A B C
2 3 1
A B C
P0
1 2 4
6 3 4
5 1 0
P1
1 0 0
6 5 3
5 5 3
P2
1 2 0
1 2 2
0 0 2
P3
2 1 1
3 5 2
1 4 1
P4
3 3 3
4 6 1
1 3 -2
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.