![]() ![]() There is a special process, the idle process, which is scheduled whenever there are no processes in the READY state. schedule() must search the ready queue, select a runnable process, and call the context_switch() function to switch the process onto the CPU. It is invoked whenever a CPU becomes available for running a process. Schedule() is the core function of the CPU scheduler. Since the ready queue is accessed by multiple processors, which may add and remove processes from the ready queue, the ready queue must be protected by some form of synchronization-for this project, it will be a mutex lock. To keep track of the processes waiting to execute, we keep a ready queue of the processes in the READY state. When there are more processes ready to execute than CPUs, processes must wait in the READY state until a CPU becomes available. On most systems, there are a large number of processes, but only one or two CPUs on which to execute them. The simulator will use this field to collect statistics. There is a field named state in the PCB, which must be updated with the current state of the process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |