1 / 15

CS1550 Recitation

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.

Download Presentation

CS1550 Recitation

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. CS1550 Recitation Mengmeng Li LMM@cs.pitt.edu Office hours: Wed 2:15-4:45pm, Fri 3:00-4:00pm Office: Sennot Square 6805

  2. goal • Review the CPU scheduling. • Exercises. • Project 1.

  3. 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:

  4. categories • Preemptive algorithm • Nonpreemptive algorithm

  5. 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.

  6. Scheduling in batch systems • First-come first-served Non-preemptive • Shortest job first Non-preemptive • Round Robin Preemptive

  7. First-come first-served • Example 1: Throughput = 60*3/(24+3+3) = 6 Turnaround time = (24 + 26 +28)/3 = 26

  8. First-come first-served • Exercise 1

  9. First-come first-served • Exercise 2

  10. 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

  11. Shortest job first • Exercise 1

  12. Shortest job first • Example 2:

  13. 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)

  14. Round Robin • Exercise

  15. Project 1 • Run the skeleton programs.

More Related