cs 377 discussion 3 brendan murphy bemurphy cs umass edu
play

CS 377 Discussion 3 Brendan Murphy bemurphy@cs.umass.edu enter - PowerPoint PPT Presentation

CS 377 Discussion 3 Brendan Murphy bemurphy@cs.umass.edu enter Dept name in Slide Master enter Dept name in Title Master 1 Reminders Lab 1 due Oct. 8 Assignment details should be on website enter Dept name in Slide Master 2 For


  1. CS 377 Discussion 3 Brendan Murphy bemurphy@cs.umass.edu enter Dept name in Slide Master enter Dept name in Title Master 1

  2. Reminders § Lab 1 due Oct. 8 § Assignment details should be on website enter Dept name in Slide Master 2

  3. For Today... § Review of process scheduling algorithms: – FCFS – Round Robin – SJF – MLFQ – Lottery Scheduling § Worksheet enter Dept name in Slide Master 3

  4. For Today... § Review of process scheduling algorithms: – FCFS – Round Robin – SJF – MLFQ – Lottery Scheduling § Worksheet enter Dept name in Slide Master 4

  5. FCFS § What is it? – First come first serve: jobs are scheduled in the order that they arrive § Advantages? – Simplicity § Disadvantages? – Average wait time can be high if shorter jobs are scheduled after longer jobs – Poor use of both I/O and CPU, CPU bound jobs force I/O bound jobs to wait for CPU enter Dept name in Slide Master 5

  6. Round Robin § What is it? – Use time slice and preemption to switch between jobs § Advantages? – Fairness: each job uses CPU equally § Disadvantages? – Average wait time can be bad enter Dept name in Slide Master 6

  7. SJF § What is it? – Shortest job first: do short jobs before long ones § Advantages? – Provably optimal in minimizing average wait time § Disadvantages? – Impossible to predict how long a job will take – Long jobs can possibly starve enter Dept name in Slide Master 7

  8. MLFQ § What is it? – Multi-level feedback queues: multiple queues with different priorities – Round robin at each level, completing time slice reduces priority § Advantages? – Adaptive: past behavior predicts the future – Approximates SJF § Disadvantages? – Fairness: long jobs can starve enter Dept name in Slide Master 8

  9. Lottery Scheduling What is it? § Every job has a number of tickets, winning ticket – randomly chosen Give more tickets to shorter jobs, every jobs gets at – least 1 ticket Advantages? § Avoids starvation – Approximates SJF – § Disadvantages? Adding/deleting jobs affects all jobs proportionately, – independent of number of tickets enter Dept name in Slide Master 9

Recommend


More recommend