新流程位于何处?在主内存还是辅助内存中?
Where does a New Process reside? In Primary Memory or Secondary Memory?
当一个进程被长期调度程序选择时,进程进入就绪队列(新状态就绪状态)并且就绪队列中的所有进程都存在于主内存中。但是当进程处于新状态时,它位于何处?在主内存还是辅助内存中?
但是,由于就绪队列进程存储在主内存中,因此,新进程可能驻留在辅助内存中!但是找不到合适的理由!
当进程在通过 fork
系统调用或类似的东西创建后立即处于 "new" 状态时,它最初驻留在主内存中。根据可用内存量,OS 可能会决定将其换出到辅助存储或保留在主内存中。参考下面的进程状态转换图(摘自The Design of Unix Operating System)-
直接引用The Design of Unix Operating System-
The process enters the state model in the "created" state when the parent process executes the fork system call and eventually moves into a state where it is ready to run (3 or 5). The process scheduler will eventually pick the process to execute, and the process enters the state "kernel running" where it completes its part of the fork system call.
当一个进程被长期调度程序选择时,进程进入就绪队列(新状态就绪状态)并且就绪队列中的所有进程都存在于主内存中。但是当进程处于新状态时,它位于何处?在主内存还是辅助内存中?
但是,由于就绪队列进程存储在主内存中,因此,新进程可能驻留在辅助内存中!但是找不到合适的理由!
当进程在通过 fork
系统调用或类似的东西创建后立即处于 "new" 状态时,它最初驻留在主内存中。根据可用内存量,OS 可能会决定将其换出到辅助存储或保留在主内存中。参考下面的进程状态转换图(摘自The Design of Unix Operating System)-
直接引用The Design of Unix Operating System-
The process enters the state model in the "created" state when the parent process executes the fork system call and eventually moves into a state where it is ready to run (3 or 5). The process scheduler will eventually pick the process to execute, and the process enters the state "kernel running" where it completes its part of the fork system call.