什么是进程?
运行中的程序.什么是程序?
可执行的代码.程序如何转化为进程?
一个已经存在的进程使用系统调用创建新进程.
fork –> 创建新进程, 父进程的副本.
exec –> 替换父进程中的代码.如何停止进程?
进程中的代码正常退出或者是出错退出.
被操作系统终止.进程的状态?
进程元信息.
Process control information is used by the OS to manage the process itself. This includes:
1. The process scheduling state, e.g. in terms of “ready”, “suspended”, etc., and other scheduling information as well, like a priority value, the amount of time elapsed since the process gained control of the CPU or since it was suspended. Also, in case of a suspended process, event identification data must be recorded for the event the process is waiting for.
2. Process structuring information: process’s children id’s, or the id’s of other processes related to the current one in some functional way, which may be represented as a queue, a ring or other data structures.
Interprocess communication information: various flags, signals and messages associated with the communication among independent processes may be stored in the PCB.
3. Process privileges, in terms of allowed/disallowed access to system resources.
4. Process state: State may enter into new, ready, running, waiting, dead depending on CPU scheduling.
5. Process No.: a unique identification number for each process in the operating system.
6. Program counter: a pointer to the address of the next instruction to be executed for this process.
7. CPU registers: indicates various register set of CPU where process need to be stored for execution for running state.
8. CPU scheduling information: indicates the information of a process with which it uses the CPU time through scheduling.
9. Memory management information: includes the information of page table, memory limits, Segment table depending on memory used by the operating system.
10. Accounting information: includes the amount of CPU used for process execution, time limits, execution ID etc.
11. IO status information: includes a list of I/O devices allocated to the process.
- 进程表.
多个进程元信息组成的表.