[OSTEP Chapter7] Scheduling: Introduction

By now low-level mechanisms of running processes should be clear. However, we have yet to understand the high-level policies that an OS scheduler employs.

工作量假设

workload accumptions

  1. Each job runs for the same amount of time
  2. All jobs arrive at the same time
  3. Once started, each job runs to completion.
  4. All jobs only use CPU
  5. The run-time of each job is known

策略计量单位 turnaround time

T[^turnaround] = T[^completion] – T[^arrival]

策略介绍

7.3 First In, First Out (FIFO)

FIFO 的优点:简单清晰,易于实现,工作良好

7.4 Shortest Job First (SJF)

最短的先运行

7.5 Shortest Time-to-Completion First (STCF)

最短的先完成

新计量单位 : Response Time 相应时间 —-任务到达系统和被体统调用的时间差

T[^response] = T[^firstturn] – T[^arrival]

之前的策略在响应时间上表现不是很好

7.7 Round Robin

instead of running jobs to completion, RR runs a job for a time slice (sometimes called a scheduling quantum) and then switches to the next job in the run queue

7.8 Incorporation I/O 纳入IO/考虑IO

relax assumption 4

Doing so allows for overlap, with the CPU being used by one process while waiting for the I/O of another process to complete

Published by

Leave a Reply

Your email address will not be published. Required fields are marked *