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

cs 377 discussion 3 brendan murphy bemurphy cs umass edu
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

1 enter Dept name in Slide Master enter Dept name in Title Master

Brendan Murphy bemurphy@cs.umass.edu CS 377 Discussion 3

slide-2
SLIDE 2

2 enter Dept name in Slide Master

Reminders

§ Lab 1 due Oct. 8 § Assignment details should be on website

slide-3
SLIDE 3

3 enter Dept name in Slide Master

For Today...

§ Review of process scheduling algorithms:

– FCFS – Round Robin – SJF – MLFQ – Lottery Scheduling

§ Worksheet

slide-4
SLIDE 4

4 enter Dept name in Slide Master

For Today...

§ Review of process scheduling algorithms:

– FCFS – Round Robin – SJF – MLFQ – Lottery Scheduling

§ Worksheet

slide-5
SLIDE 5

5 enter Dept name in Slide Master

FCFS

§ What is it?

– First come first serve: jobs are scheduled in the

  • rder 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

slide-6
SLIDE 6

6 enter Dept name in Slide Master

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

slide-7
SLIDE 7

7 enter Dept name in Slide Master

SJF

§ What is it?

– Shortest job first: do short jobs before long

  • nes

§ Advantages?

– Provably optimal in minimizing average wait

time § Disadvantages?

– Impossible to predict how long a job will take – Long jobs can possibly starve

slide-8
SLIDE 8

8 enter Dept name in Slide Master

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

slide-9
SLIDE 9

9 enter Dept name in Slide Master

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