OS: Does the process scheduler execute a separate process

I have little doubt about how the operating system works.

Scheduler: Does the scheduler execute in a separate process (like any other process). What exactly happens during the exchange in the new process (I know that the processor registers and memory tables are updated, my question is how they are updated. Can we write a program to update the registers (sc, pc) to point to another process) .

+5
source share
1 answer

The process schedule can be executed in a separate process, but such a design will be very inefficient, since you will have to move from one process to a planning process (which would then have to make several system calls to the kernel) and then return to a new process, rather than just placing a scheduler in the kernel, where you do not need system calls, and do not need to change contexts more than once. Therefore, the scheduler is usually located in the exclusive area of ​​the kernel.

Here are the steps that occur:

  • The scheduler determines which process will be executed in the next time interval (using various algorithms).

  • The scheduler tells the memory management unit (MMU) to use the page table to start the next process (this is done by setting a register to point to the table).

  • (PIT) N .

  • ( )

  • , .

  • N , PIT, .

  • ( ..) , ( ), 1.

, , . , ( ) (, , , ..), ( ) .

, , :

" , ?"

, . .

+5

All Articles