Professional Documents
Culture Documents
Present to:
Dr. Ahmed Almaghrawi
1) 2) 3) 4) 5) 6) 7)
overview Introduction Scheduling Criteria Type of scheduling Scheduling Algorithms proposed conclusion
scheduler to maximize CPU utilization, response time and minimize waiting time and turnaround time .
Process 1
Process 2
Process 3
1-Utilization/Efficiency.
2-Throughput.
3-Turnaround time. 4- Response Time. 5- Waiting time 6-Fairness.
1- Long term scheduling 2- Medium term scheduling 3- Short term scheduling (or dispatching):
1. first come first serve ( FCFS) 2. shorter time first (SJF) 3. Round Robin (RR) 4. Priority
5. Multilevel queue
1.
first come first serve ( FCFS) Tasks are performed by priority and arrival FIFO is a non-preemptive algorithm Here disadvantages non-optimal utilization of the processor and never considered inappropriate for use in interactive systems
1.
P1 3 time unit
P2 4 time unit
P3 2 time unit
PCB
PCB
PCB
CPU
1.
P4
P1 0
waiting time p1= 0 &
8
p2 = 8
P2 12
& p3 = 12
P3 21
& P4=21
P4 26
P2 4 time unit
P3 2 time unit
PCB
PCB
CPU
Non Preemptive
P1 0 waiting time p1= 0 8 &
P2 p2 = 7 12 &
P4 17 p3 = 15
P3 26 & P4=9
P2 1
p2 = 0 &
P4 5
p3 = 15
P1 10
& P4=2
P3 17 26
fair distribution of time between processes Is preemptive scheduler Starvation not occur for process algorithm like FCFS but here each time Execution process defined within the CPU.
5) 6)
If the duration of very large Quantum became like FCFS If the duration of a very small Quantum mobility processes have become a waste of time
P2 4 time unit
P3 2 time unit
PCB
PCB
CPU
P2 4 time unit
P3 2 time unit
PCB
PCB
CPU
P3 2 time unit
PCB
CPU
P2 2 time unit
PCB
P1 1 time unit
PCB
P2 2 time unit
PCB
CPU
P3 2 time unit
PCB
8
4 9
P1
P2 P3 P4
0
1 2 3
Quantum = 4 P1
0 4
P2
8
&
P3
12
P4
16
&
P1
20
P3
24
P4
25
P3
26
p2 = 3
p3 = 13
& P4=17
4- Priority Scheduling (PS): 1)Implemented depending on the priority of process 2)Greater priority process executed in the first 3)The priority is an integer number 4) lower numbers are used to represent higher priorities 5) Starvation : low priority processes may never execute. .Solution [ Aging : as time progresses increase the priority of the process].
4. priority
Priority 2 1 3 4 Burst time 8 4 9 5 Process P1 P2 P3 P4
P2
0 4
P1
12
& p2 = 0
P3
21
& p3 = 12
P4
26
& P4=21
5-Multilevel queue 5-2 feedback multilevel Scheduling Algorithm A process can move between the various queues; aging can be implemented this way.
In this algorithm was merged two algorithms RR and SJF to try to determine the quantum time for RR algorithm and disposal of the starvation in SJF. 1-calculate the average of the time needed at finish the process which is in the queue 2- The result of the average is considered as quantum 3- Round Robin algorithm is applied on the process which has short time must the run first
Process
Arrival Time
8
4 9 5
P1
P2 P3 P4
0
1 2 3
Q1=Average =
P2 P4
= 6.5
P1 P3
Q2=Average = P1
4 P3 26
&
92 =
15.5
22
23.5
waiting time p1= 18.5
p2 = 0
&
p3= 15
& P4=1
P1 4 time unit
P2 3 time unit
P3 4 time unit
P4 1 time unit
PCB
PCB
PCB
PCB
CPU
P1 4 time unit
P3 4 time unit
PCB
PCB
CPU
P3 4 time unit
PCB
P1 1 time unit
PCB
P3 1 time unit
P3 1 time unit
PCB
PCB
CPU
The given table gives a comparison between RR,SJF and PROPOSED algorithms
Context
time 3 7 4
Turnaround
time 13 17.75 15.125
Average waiting
time 6.5 11.25 7.5
Scheduling
algorithm SJF RR proposed algorithm
Conclusion
Comparison of various types of algorithms, examining the advantages and drawbacks of various algorithms we can proposed a new scheduling algorithm which can solve drawbacks of discussed algorithms We Increase the Performance, Throughput and decrease the Turnaround Time by solves Round Robin with SJF. advantages of algorithms proposed 1- Calculate the average burst time of processes and is regarded as quantum time (time
FCFS
SJF
RR
PS