正文

OSQ1: What is the function of a dispatcher?

(2008-04-16 17:12:18) 下一个
The dispatcher prpgram that moves the processor from one process to another. We assume that the operating system only allows a process to continue execution for a maximum of six instruction cycles, after which it is interrupted; this prevents any single process monopolizing processor time. As the figure 3.1 on the text book shows, the first six instructions of process A are executed, followed by a time-out and the execution of some code in the dispatcher, which turns control to process B. After four instructions are executed, process B requests an I/O action for which it must wait. Therefore, the processor stops executing process B and moves on, via the dispatcher. to process C, after a time-out, the processor moves back to process A. When this process out, process B is still waiting for the I/O operation to complete, so the dispatcher moves on to process C again.

In the Two-state Process Model, when the operation system creates a new process, it enters that process into the system in the Not-running state. The process exists, is known to the operating system, and is waiting for an opportunity to execute. From time to time, the currently running process will be interrupted and the dispatcher portion of the operating system will select a new process to run.

In either case, the dispatcher then selects a process from the queue to execute.

Some processes in the Not-running state are read to execute, while others are blocked, waiting for an I/O operation to complete. Thus, using a single queue, the dispatcher could not just select the process at the oldest end of the queue. Rather, the dispatcher would have to scan the list looking for the process that is not blocked and that has been in the queue the longest.


dispatcher n.发送者,调度员








[ 打印 ]
阅读 ()评论 (1)
评论
目前还没有任何评论
登录后才可评论.