Hello, I am working on CPU scheduling assignment which is to find out what sched
ID: 3598566 • Letter: H
Question
Hello, I am working on CPU scheduling assignment which is to find out what scheduling algorithm is.
The questions are on the bottom and need to solve based on the simulated workload. I think it is preempitve and the algorithm is priority scheduling but not sure.
Need helps to answer the below questions.
------------------------------------------------------
| Simulated workload |
------------------------------------------------------
arriv. prio. CPUb IOb iter.
- job1: 0 1 4 3 4
- job2: 1 4 5 2 4
- job3: 2 3 4 2 5
- job4: 1 1 3 5 3
------------------------------------------------------
| X: execute | R: ready | B: blocked |
------------------------------------------------------
job1 job2 job3 job4
0: X - - -
1: X R - R
2: X R R R
3: X R R R
4: B R R X
5: B R R X
6: B R R X
7: X R R B
8: X R R B
9: X R R B
10: X R R B
11: B R X B
12: B R R X
13: B R R X
14: R R R X
15: X R R B
16: X R R B
17: X R R B
18: X R R B
19: B R X B
20: B R R X
21: B R R X
22: R R R X
23: X R R B
24: X R R B
25: X R R B
26: X R R B
27: B R X B
28: B R X -
29: B X B -
30: - X B -
31: - R X -
32: - R X -
33: - R X -
34: - R X -
35: - X B -
36: - X B -
37: - R X -
38: - R X -
39: - R X -
40: - R X -
41: - X B -
42: - B B -
43: - B X -
44: - R X -
45: - R X -
46: - R X -
47: - X B -
48: - X B -
49: - R X -
50: - R X -
51: - R X -
52: - R X -
53: - X B -
54: - X B -
55: - X - -
56: - B - -
57: - B - -
58: - X - -
59: - X - -
60: - X - -
61: - X - -
62: - X - -
63: - B - -
64: - B - -
65: - X - -
66: - X - -
67: - X - -
68: - X - -
69: - X - -
70: - B - -
71: - B - -
------------------------------------------------------
| Summary statistics |
------------------------------------------------------
turnaround time wait time
--------------------------------------
job1 30 2
job2 71 43
job3 53 23
job4 27 3
[q1.1] Is it preemptive?
[q1.2] Does it prioritize jobs based on earliest arrival times?
[q1.3] Is it Round-Robin?
[q1.4] Does it prioritize jobs based on their priorities?
[q1.5] Which scheduling algorithm is it?
Explanation / Answer
[q1.1] Is it preemptive?
Ans : Yes, this is certainly preemptive because in 19: B R X B the job3 is executing and its burst time is 4 but in just next clock 20: B R R X job3 is moved to ready state and job4 is now executing, this is a preemptive behavior.
[q1.2] Does it prioritize jobs based on earliest arrival times?
Ans : No, As we can see in 13: B R R X , 14: R R R X job1 was in Blocked state and in the next clock it moves to ready state while job4 is under execution. Had it prioritized the jobs on their arrival time then in Clock 14 job4 should have moved to ready state to get job1 executing.
[q1.3] Is it Round-Robin?
Ans: No, Because round robin distributes equal time frames for execution to all the processes in a queue.
[q1.4] Does it prioritize jobs based on their priorities?
Ans: Yes, It does proritize the processes based on their priorities as we can see in the following clocks 10: X R R B , 11: B R X B , 12: B R R X job3 started executing in clock 11 and in clock 12 job4 gets out of blocked state and starts executing while job3 which was executing earlier again gets back to ready state because of its low priority when compared with the priority of job4.
[q1.5] Which scheduling algorithm is it?
Ans : It is Priority Scheduling algorithm with preemption.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.