Problem 6 The following tables show the timing for processes using two different scheduling algorithms based on the table of process arrival times and burst times (All ties were resolved using the arrival time). Using this information:
Process |
Arrival Time |
Burst Time |
P1 |
0 |
4 |
P2 |
3.9 |
1 |
P3 |
2.9 |
3 |
P4 |
0.9 |
2 |
P5 |
1.9 |
4 |
Mystery Algorithm #1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
P1 |
|||||||||||||
P2 |
|||||||||||||
P3 |
|||||||||||||
P4 |
|||||||||||||
P5 |
Average Turnaround Time:
Name of the algorithm:
Mystery Algorithm #2
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
P1 |
P1 |
P1 |
|||||||||||
P2 |
|||||||||||||
P3 |
|||||||||||||
P4 |
|||||||||||||
P5 |
Average Turnaround Time:
Name of the algorithm:
EXPLANATION:
Turnaround Time of a single process = Completion Time - Arrival Time
Average Turnaround Time = Sum of Turnaround Time of all processes / Number of process.
Completion Time of a process = The time which has passed away till now + burst time
Mystery Algorithm #1
Turnaround Time of Process 1 = 4 - 0 = 4
Turnaround Time of Process 2 = 7 - 3.9 = 3.1
Turnaround Time of Process 3 = 10 - 2.9 = 7.1
Turnaround Time of Process 4 = 6 - 0.9 = 5.1
Turnaround Time of Process 5 = 14 - 1.9 = 12.1
Average Turnaround Time = ( 4 + 3.1 + 7.1 + 5.1 + 12.1 ) / 5 = 31.4 / 5 = 6.28
Name of the algorithm = Shortest Job First ( Non Preemptive ) - In this algorithm the processes which have the shortest burst time are scheduled first. If 2 processes have the same bust time then First Come First Serve algorithm is used to break the tie.
Mystery Algorithm #2
Turnaround Time of Process 1 = 7 - 0 = 7
Turnaround Time of Process 2 = 4.9 - 3.9 = 1
Turnaround Time of Process 3 = 10 - 2.9 = 7.1
Turnaround Time of Process 4 = 2.9 - 0.9 = 2
Turnaround Time of Process 5 = 14 - 1.9 = 12.1
Average Turnaround Time = ( 7 + 1 + 7.1 + 2 + 12.1 ) / 5 = 29.2 / 5 = 5.84
Name of the algorithm = Shortest Remaining Time First ( Preemptive ) - It is preemptive mode of Shortest Job First algorithm in which jobs are schedule according to shortest remaining time. In preemptive scheduling, the job which is being executed can be stopped at the arrival of a job which has a shorter remaining execution time than the currently executing process.
THANKS,
PLEASE UPVOTE THE ANSWER.
Get Answers For Free
Most questions answered within 1 hours.