OPERATING SYSTEM-"Scheduling policies"
-
Upload
ankit-surti -
Category
Technology
-
view
220 -
download
0
Transcript of OPERATING SYSTEM-"Scheduling policies"
![Page 1: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/1.jpg)
SCHEDULING POLICIES
B.Sc.IT325
ANKIT SURATI
![Page 2: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/2.jpg)
TYPES OF SCHEDULER
1.LONG-TERM SCHEDULER:DETERMINE WHICH JOBS ARE ADMITTED TO THESYSTEM FOR PROCESSING.2.MEDIUM-TERM SCHEDULER:WHEN TO MANY PROCESSOR ARE COMPETING FOR MEMORY,DETERMINES WHICH GETS IN/OUT.3.SHORT –TERM SCHEDULER:DETERMINES WHICH PROCESS IN MEMORY GOES NEXT.
![Page 3: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/3.jpg)
SCHEDULING PERFORMANCE
• TURN AROUND TIME:Time process present in system
• WAITING TIME:Time process present and not running
• RESPONSE RATIO:Factor by which processing rate reduces
![Page 4: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/4.jpg)
• TURN AROUND TIME:T=[finish time]-[arrival time]
• WAITING TIME:W=T-[service time]
• RESPONSE RATIO:R= T/(service time)
![Page 5: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/5.jpg)
Decision Mode
• NON-PREEMPTIVE:A PROCESS RUNS UNTIL ITS BOLCK ARE COMPLETES(runs until no longer ready)
• PREEMPTIVE:OS CAN INTERRUPT CURRENTLY RUNNING PROCESS
TO START ANOTHER ONE
![Page 6: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/6.jpg)
FIRST-COME, FIRST-SERVED
• Criteria: BT-AT Where BT=burst time AT=arival time• Mode:non-preemptive• Scheduling criteria: Jobs are excuted on first cum first serve basis
![Page 7: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/7.jpg)
• Advantage: Easy to understand and implement. • Disadvantage: Poor in performance as average wait time is high.• Example: Pno Burst time P1 24 P2 3 P3 3Result: p1 p2 p3 0 24 27 30
![Page 8: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/8.jpg)
SHORTEST JOB FIRST
• Mode:non-preemptive• Scheduling criteria: It is assigned to the process that has smallest next cpu burst.• Disadvantage: SJF is non-preemptive like FCFS, therefore not useful in time sharing environment.
![Page 9: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/9.jpg)
• Example: Pno BT P1 6 P2 8 P3 7 P4 3 Result: p4 p1 p3 p2 0 3 9 16 24
![Page 10: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/10.jpg)
SHORTEST REMAINIG TIME FIRST
• Mode:pre-emptive• Scheduling criteria: The process which is having shortesr remaining time is excuted first and completed.• Advantage: Short process are handled quickly• Disadvantage: Estimation of remaining t UK me is not easy.
![Page 11: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/11.jpg)
• Example: pno AT BT 1 0 7 2 1 6 3 2 3 4 3 1 5 4 2 6 5 1Result: p1 p1 p3 p4 p3 p3 p6 p5 p1 p2 0 1 2 3 4 5 6 7 9 14 20
![Page 12: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/12.jpg)
Highest Response Ratio
• Highest Response Ratio Next(HRRN)Decision mode:non-preemptiveArbitration rule: schedules job having highest
response ratio and runs until completion.Priority function:p(a,r,t)= = (burst time+waiting time) _________________________ burst time
![Page 13: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/13.jpg)
*Advantages:– It is better than SRTF & SJF
*Disadvantages:– Caculation of response ratio
*Example: Pno AT BT 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2 Result: p1 p2 p3 p5 p4 0 3 9 13 15 20
![Page 14: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/14.jpg)
ROUND ROBIN
• Criteria: AT+TQ where AT=arival time TQ=time quantum• Mode: pre-emptive• Scheduling criteria: It schedules job as per AT (takes from front of queue) & executes till TQ is completed (then puts back to request queue) or time is over.
![Page 15: OPERATING SYSTEM-"Scheduling policies"](https://reader037.fdocuments.us/reader037/viewer/2022083118/5875d2fa1a28ab8f438b59c9/html5/thumbnails/15.jpg)
Thank you