00:00

Process Scheduling for Interactive Systems

Review of scheduling algorithms for batch and interactive systems, including FCFS, SJF, SRTN, Round-Robin, Priority, Multiple Queues, and Lottery Scheduling. Goals include fairness, policy enforcement, balance, response time, and proportionality. Different priority levels, dynamic and static multiple queues, and probabilistic guarantees in lottery scheduling are discussed with examples and Gantt charts.

bombi
Download Presentation

Process Scheduling for Interactive Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 23: Process Scheduling for Interactive Systems

  2. Review: Scheduling Algorithms for Batch Systems • First come first serve • Shortest job first • Shortest remaining time next

  3. Review: Scheduling Algorithm Goals • All Systems – Fairness – giving each process a fair share of the CPU – Policy enforcement – seeing that stated policy is carried out – Balance – keeping all parts of the system busy

  4. Review: Scheduling Algorithm Goals • Interactive Systems – Response time – respond to requests quickly – Proportionality – meet users’ expectations

  5. Scheduling Algorithms for Interactive Systems • Round-Robin scheduling • Priority scheduling • Multiple queues • Lottery scheduling

  6. Round Robin – Give CPU time to each process by turn – Quantum = CPU time allotted every turn – how to choose the value of the quantum? • Too small might mean high context switch overhead • Too large might mean bad response times

  7. Priority Scheduling Different Priorities: • Background process sending mail vs: • Shell process accepting input Requirement: • Schedule jobs with highest priority first • Issue: high priority jobs should not overwhelm the others – Might decrease priority with time

  8. Multiple Queues – static version System level processes High Interactive processes Background processes Low • Lower priority queues don’t run if higher priority queues non-empty • Could time slice between queues

  9. Multiple Queues – dynamic version High Quantum = 1 Quantum = 2 Low Quantum = 4 • Process enters high priority level • If takes more than 1 quantum, moved to second highest priority, …..

  10. Multiple Queues – dynamic version • Higher priority = faster service, but short service times • Reduce number of context switches for long processes

  11. Lottery Scheduling • Example: 3 processes, priorities 2, 3, 5 • Distribute 20, 30, 50 tickets respectively • System holds “lottery” 50 times a second – Winner gets 20 ms of CPU time • Gives probabilistic guarantees

  12. RR, Q = 10 Arrival time CPU burst 0 P1: 4 36 8 112 1 I/O burst P2: 23 40 2 13 P3: 4 20 112 40 2 40 2 40 1 16 P4: 2 150 3 10 1 20 Gantt chart 0

  13. RR, Q = 10 0 P1: 4 36 8 112 1 P2: 23 40 2 13 P3: 4 20 112 40 2 40 2 40 1 16 P4: 2 150 3 10 1 20 Which process goes next, and when? Gantt chart P1 idle P2 P3 P4 0 4 13 23 27 29

  14. RR, Q = 10 40 0 P1: 4 36 8 112 1 P2: 23 40 2 82 13 P3: 4 20 112 40 2 40 2 40 1 47 16 P4: 2 150 3 10 1 179 20 Gantt chart P1 idle P2 P3 P4 P2 0 4 13 23 27 29 42

  15. RR, Q = 10 162 0 P1: 4 36 8 112 1 P2: 23 40 2 End 13 P3: 4 20 112 40 2 40 2 40 1 Run 16 P4: 2 150 3 10 1 179 20 Gantt chart P1 idle P2 P3 P4 P2 P1 P3 P2 P3 0 4 13 23 27 29 42 50 90 92

  16. RR, Q = 10 End 0 P1: 4 36 8 112 1 P2: 23 40 2 End 13 P3: 4 20 112 40 2 40 2 40 1 205 16 P4: 2 150 3 10 1 179 20 Gantt chart P1 idle P2 P3 P4 P2 P1 P3 P2 P3 P1 P3 idle 0 4 13 23 27 29 42 50 90 92 162 163 165

More Related