CPU调度(CPU Scheduling)

Basic Concepts

Scheduling Criteria(调度标准)

  CPU利用率(CPU utilization)  --keep the CPU as busy as possible 

  吞吐率(Theoughput)  --of the process that complete their execution per time unit

    是指一个时间单元内所完成的进程的数量。

    (长进程可能为1h一个进程,短进程可能为1s10个进程)

  周转时间(Turnaround time)  --amount of time to execute a particular processs

    从进程提交到进程完成的时间为周转时间

    为所有时间段之和(包括等待进入内存,在就绪队列中等待,在CPU上执行和IO执行)

  等待时间(Waiting time)  --amount of time a process has been waiting in the ready queue

    CPU调度算法并不影响进程运行和执行IO的时间;它只影响进程在就绪队列中花费的时间

    等待时间为在就绪队列中等待所花费的时间之和。

  响应时间(Response time)  --amount of time it takes from when a request was submitted until the first response is produced, not output

    响应时间时开始响应需要的时间。

我们在设计的时候:

  Max CPU utilization

  Max throughput

  Min turnaround time

  Min waiting time

  Min response time

Scheduling Algorithms

  FCFS 先来先服务

    使用FIFO队列简单实现:先请求CPU的先分配到CPU

  SJF 短作业优先

  Priority Scheduling 优先级

  Round Robin 时间片轮转

  Multilevel Queue 多级队列

  Multilevel Feedback Queue 多级反馈队列

Algorithm Evaluation

猜你喜欢

转载自www.cnblogs.com/nitrogenousfish/p/9962580.html