Chap 3. Process

Process: (informally) a program in execution

进程:正在执行(进行)中的程序

(formally)进程是具有独立功能的程序在某个数据集合上的一次运行活动,是系统进行资源分配、调度和保护的基本单位

3.1 Process Concept

status of the current activity of a process: program counter + contents of the processor's registers

https://i.loli.net/2020/09/25/NK5BPsQfEmH6wtx.png

memory layout:

https://i.loli.net/2020/09/25/3pwsh9XUOfo6tLR.png

program != process

program是静态的(存储在硬盘上的某些可执行文件),而process则是动态的(将静态的program加载到内存,然后被CPU执行)

可以有2个processes运行着同一个program,这2个processes被视为是不同的。

process 有以下几个states: