CS/OS

[OS] Process switching 과정(Change of process state)

Yeji Heo 2023. 2. 26. 16:02

1. Save the context of the processor

현재 프로세서의 상태(pc값, cpu의 레지스터 등)을 pcb에 저장한다.

 

2. Update the process control block of the process currently in the ( running ) state

현재 실행(running)중인 프로세스를 blocked/ ready/ suspend로 바꾼다.

 

3. Move the process control block of this process to the appropriate queue

 

4. Select another process for execution

들어올 프로세스를 고른다(스케줄링에 따라)

 

5. Update the process control block of the process selected

골라진 프로세스의 pcb를 업데이트한다.

 

6. Update memory management data structures

 

7. Restore the context of the processor to that which existed at the time the selected process was last switched out

들어올 프로세스를 running으로 바꾼다.