Escolar Documentos
Profissional Documentos
Cultura Documentos
Scheduling
the duology
soni@its-sby.edu
Review
WHY scheduling ?
Multitask Schedule Process
Scheduling Factor
SCHEDULING METHOD
FIRST COME FIRST SERVE (FCFS / FIFO)
SORTHEST JOB FIRST (SJF)
PRIORITY BASED
ROUND ROBIN
Burst
time
Service
Time
Completion
time
p1
24
24
p2
24
27
p3
27
30
Burst
time
Service
Time
Completion
time
p1
24
??
??
p2
??
??
p3
??
??
CONVOY EFFECT
short process behind long process
Non - Preemptive
Waiting time :
p1=0 ; p2=6; p3=3; p4=7
Average = (0 + 6 + 3 + 7)/4 = 4 ms
Preemptive
Waiting time :
p1=9 ; p2=1; p3=0; p4=2
Average = (9 + 1 + 0 + 2)/4 = 3 ms
Best approach to minimize waiting time.
Impossible to implement
Processer should know in advance how much time process will take.
operating system CPU Scheduling
PRIORITY BASED
Waiting time :
p1=6 ; p2=0; p3=16; p4=18; p5=1
Average = (6 + 0 +16 + 18 + 1)/5 = 8.2 ms
Each process is assigned a priority. Process with highest priority is to be executed first and so on.
Processes with same priority are executed on FCFS
Priority can be decided based on memory requirements, time requirements or any other resource
requirement.
RR with Quantum - 4
Proces
Execute
time
p1
24
p2
p3
10
Example of Multilevel
Three queues:
Q0 - RR with Q 8 milliseconds
Q1 - RR with Q 16 milliseconds
Q2 FCFS
A new job enters queue Q0 which is served FCFS. When it gains CPU, job receives 8
milliseconds. If it does not finish in 8 milliseconds, job is moved to queue Q1 .
At Q1 job is again served FCFS and receives 16 additional milliseconds. If it still does
not complete, it is preempted and moved to queue Q2
11
References
1. Abraham Silberschatz, Peter Baer Galvin, Greg
Gagne, Operating System Concepts With Java,
Wiley
operating system
12
Assignment 3
Use Software OS Simulator OS SIM for simulating CPU/Process
Scheduling : FCFS, SJF, Priority, and RR (available at elearning)
Each Student will get his/her unique data. 10 processes for each
student. It has various priority for priority-based. And 5 scenarios for
RR based on the quantum time.
(see googledocs spreadsheet Sheet CPU Scheduling)
Make sure you understand the software before insert the data
All that I can say is GOOD LUCK
SUBMISSION
Submit your report to elearning
REPORT must contain :
1. Cover page : Student id, and bla bla bla
2. Software utilization. How to add, process, and get the result
(including some screenshots)
3. Analyze the result based on each scheduling method
4. Analyze more by summarizing or comparing scheduling
methods
Give your best analysis (because you would be a systems
analyst)
Format : AS3-<NRP>.pdf (eg. AS3-5214100010.pdf)
operating system - process
18