Starting from:

$35

Assignment 4 – Calculation of CPU Scheduling

COMP 3411: Operating Systems 1
TRU Open Learning
Assignment 4 – Calculation of CPU Scheduling
Algorithms (5%)
Introduction
Assignment 4 contributes 5% towards your final course grade and the assignment
total is 20 marks. You should begin Assignment four after completing the materials
in Module five; it is due at the end of Module six. Check your Course Schedule for
the precise due date. Directions for submitting Assignment 4 to your Open Learning
Faculty Member for grading can be found in the Assignments Overview tab. An
assignment marking criteria and your assignment submission details follows at the
end of this document.
In this assignment, you will calculate the turnaround time and the waiting time for
various CPU scheduling algorithms. The efficiency of Operating System depends on
two main factors:
• Algorithms used for scheduling; and
• The environment in which theses algorithms are implemented.
Questions:
1. CPU scheduling:
Use the formulas
Turnaround time per process = completion time – arrival time
Wait time per process = turnaround time – burst time
Note: A larger number indicates a higher priority
Process Arrival Time Burst Time Priority
P1 0 16 8
P2 0 10 10
2 Assignment 4
TRU Open Learning
P3 3 5 6
P4 5 8 10
P5 8 12 5
For each of Round Robin, First Come First Serve, Priority Preemptive and
Priority Non-Preemptive draw the Gantt chart to illustrate how these
processes would be scheduled, and calculate turnaround time per process
and the wait time per process. For Round Robin, quantum = 5.
2. CPU scheduling
Process Arrival Time Burst Time Priority
P1 0 8 8
P2 0 4 10
P3 4 1 6
For each of Round Robin, First Come First Serve, Priority Preemptive and
Priority Non-Preemptive draw the Gantt chart to illustrate how these
processes would be scheduled, and calculate turnaround time per process
and the wait time per process. For Round Robin, quantum = 5.
3. CPU scheduling
Process Arrival Time Burst Time Priority
P1 0 8 8
P2 0 4 10
P3 4 1 6
P4 6 6 8
COMP 3411: Operating Systems 3
TRU Open Learning
For Shortest Remaining Time draw the Gantt chart to illustrate how these processes
would be scheduled, and calculate turnaround time per process and the wait time
per process.
4. Starvation
Indicate the algorithms, from those listed below, that could result in
starvation and explain why. Note: You should assume that each process will
use the CPU for a finite burst before performing I/O.
i. First-come, First-Served
ii. Round Robin (aka preemptive FCFS)
iii. Shortest Job First
iv. Shortest Remaining Time First (aka preemptive SJF)
v. Priority
Report Submission Details
You need to submit a report that consists of answers to the listed questions.
Assignment Marking Criteria Weighting
Q 1 /5
Q 2 /5
Q 3 /5
Q 4 /5
Total /20