CS1550 Recitation

1 / 15

# CS1550 Recitation - PowerPoint PPT Presentation

CS1550 Recitation. Mengmeng Li LMM@cs.pitt.edu Office hours: Wed 2:15-4:45pm, Fri 3:00-4:00pm Office: Sennot Square 6805. goal. Review the CPU scheduling. Exercises. Project 1. motivation.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'CS1550 Recitation' - jennifer-silva

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### CS1550 Recitation

Mengmeng Li

LMM@cs.pitt.edu

Office hours: Wed 2:15-4:45pm, Fri 3:00-4:00pm

Office: Sennot Square 6805

goal
• Review the CPU scheduling.
• Exercises.
• Project 1.
motivation
• When a computer is multiprogrammed, it frequently has multiple processes or threads competing at the same time.
• If only one CPU is available, a choice has to be made which process to run next.
• Scheduler:

The part of the OS that makes the choice.

• Scheduling algorithm:
categories
• Preemptive algorithm
• Nonpreemptive algorithm
definitions
• Throughput:

The number of jobs per hour that the system completes

• Turnaround time:

the statistically average time from the moment that a batch job is submitted until the moment it is completed.

Scheduling in batch systems
• First-come first-served

Non-preemptive

• Shortest job first

Non-preemptive

• Round Robin

Preemptive

First-come first-served
• Example 1:

Throughput = 60*3/(24+3+3) = 6

Turnaround time = (24 + 26 +28)/3 = 26

Shortest job first
• Example 1:

P1

P4

P2

P3

Throughput = 60*4/(10+8+18+3) = 6

Turnaround time = (10 + 3+ 19 + 33)/4 = 17.5

Round Robin
• Example

Time quantum: 5

• Throughput = 60*4/(10+8+18+3) = 6
• Turnaround = (23+24+33+8)/4 = 22

P1(5)

P2(5)

P3(5)

P4(3)

P1(5)

P2(3)

P3(13)

Round Robin
• Exercise
Project 1
• Run the skeleton programs.