正文

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)
評論
目前還沒有任何評論
登錄後才可評論.