CHAPTER 9 UNIPROCESSOR SCHEDULING 机调度
CHAPTER 9 UNIPROCESSOR SCHEDULING (单处理机调度)
Aim of Scheduling Processor eficiency (处理机效率) 多进程竞争CPU,合理安排调度 · Fairness公平性,防止进程饥饿) (通过调度算法来安排调度次序,满足系 统的设计目标)
Aim of Scheduling • Processor efficiency(处理机效率) (多进程竞争CPU,合理安排调度) • Fairness(公平性,防止进程饥饿) (通过调度算法来安排调度次序,满足系 统的设计目标)
Types of Scheduling 调度类) 按OS的类型划分: 批处理调度、分时调度、实时调度、多处 理机调度 按调度的层次划分 Long-term scheduling(长程调度) Medium-term scheduling(中程调度 Short-term scheduling(短程调度)
Types of Scheduling (调度类型) • 按OS的类型划分: 批处理调度、分时调度、实时调度、多处 理机调度 • 按调度的层次划分: Long-term scheduling(长程调度) Medium-term scheduling(中程调度) Short-term scheduling(短程调度)
ew Long-term Long- term scheduling hedlin Readv/ Ready Running Exit Suspend Medium-term Short-term scheduling scheduling Blocked/ Blocked Suspend Medium-term schedulin Figure 9.1 Scheduling and Process State Transitions
Running Read Blocked Short Term Blocked Suspend Ready Suspend Medium Term New Figure 9.2 Levels of Scheduling
Long-term TIme -out eduling Batch Ready Queue Short-term Release 竺工∏ schedulling Medium-term i schedulIng Interactive Ready, Suspend Queue Medlum-tern medullo Blocked Suspend oueue Blocked Queue Event Event walt Occurs Figure 9.3 Queuing Diagram for Scheduling
Longterm scheduling 又称为高级度、作业源度,它为被调度作业或用 户程序创建进程、分配必要的系统资源,并将新创建 的进程插入就绪队列,等待 Short-term scheduling ·采用交換技术的系统将新创建的程插入(就绪,挂 起)队列,等待 Medium-term scheduling。 批处理系统中,作业进入系统后,先驻留在磁盘上 (批处理队列中)。长程调度从该队列中选择作业, 为之创建进程
Long-term scheduling 又称为高级调度、作业调度,它为被调度作业或用 户程序创建进程、分配必要的系统资源,并将新创建 的进程插入就绪队列,等待Short-term scheduling • 采用交换技术的系统将新创建的进程插入(就绪,挂 起)队列,等待Medium-term scheduling 。 • 批处理系统中,作业进入系统后,先驻留在磁盘上 (批处理队列中)。长程调度从该队列中选择作业, 为之创建进程
Long-Term Scheduling Determines which programs are admitted to the system for processing 这取决于调度算法,如FCFS、短作业优先、基于优 先权、响应比高者优先等调度算法 How many programs are admitted to the system Controls the degree of multiprogramming When does the scheduler be invoked? Each time a iob terminates Processor is idle exceeds a certain threshold
Long-Term Scheduling • Determines which programs are admitted to the system for processing - 这取决于调度算法,如FCFS、短作业优先、基于优 先权、响应比高者优先等调度算法 • How many programs are admitted to the system ? - Controls the degree of multiprogramming • When does the scheduler be invoked? - Each time a job terminates - Processor is idle exceeds a certain threshold
Medium-term scheduling 又称为中级调度,它调度换出到磁盘的进程进 入内存,准备执行 中程调度配合对换技术使用。 其目的是为了提高内存的利用率和系统吞吐量。 ·在多道程序度允许的情况下,从外存选择一个 挂起状态的进程调度到内存(换入)
Medium-term scheduling 又称为中级调度,它调度换出到磁盘的进程进 入内存,准备执行 • 中程调度配合对换技术使用。 • 其目的是为了提高内存的利用率和系统吞吐量。 • 在多道程序度允许的情况下,从外存选择一个 挂起状态的进程调度到内存(换入)
Short-term scheduling ·又称为进程调度、低级度,调度内存中的就 绪进程执行。 Known as the dispatcher:决定就绪队列 Which 进程将获得处理机 Executes most frequently Invoked when an event occurs Clock interrupts WO interrupts Operating system calls Signals(信号)
Short-term scheduling • 又称为进程调度、低级调度,调度内存中的就 绪进程执行。 • Known as the dispatcher:决定就绪队列Which 进程将获得处理机 • Executes most frequently • Invoked when an event occurs – Clock interrupts – I/O interrupts – Operating system calls – Signals(信号)