how dispatcher works?

后端 未结 4 1002
挽巷
挽巷 2020-12-24 14:37

I have recently started my OS course. As far as i know the work of dispatcher is to save the context of current process and load context of process to be run next. But how d

4条回答
  •  醉梦人生
    2020-12-24 15:14

    The operating system's principal responsibility is controlling the execution of processes. This includes determining the pattern for execution and allocating resources to the processes.

    A process may be in one of the two states :

    1. Running or
    2. Not Running

    When the OS creates a new process, it creates a process control block for the process and enters that process into the system into the Not Running state. The process exists is known to OS and is waiting for an opportunity to execute.

    From time to time, the currently running processes will be interrupted and the dispatcher portion of the OS will select some other processes to run.

    During execution when the process is devoid of resources, it gets blocked. Provided those resources it re-enters the ready state and then into running state. This transition from ready to running state is done by dispatcher. Dispatcher dispatches the process.

提交回复
热议问题