Processes can be considered as executing programs. A process requires resources (such as CPU time, memory, files, and I/O devices) to complete its tasks. These resources are allocated when a process or execution thread is created.
A process is a program executed, which is informal. A process is not just a program code.Text Section. The process also includes the current activity.Program countersValue and the content of the Processor register. In addition, processes usually include processesStack segment(Including temporary data, such as method parameters, return addresses, and local variables) and data segments (including global variables ).
The program itself is not a process; the program is only a passive entity, such as the file content stored on the disk, and the process is an active entity, it has a program counter to indicate the next command to be executed and a collection of related resources.
The process changes its status during execution.
New: the process is being created.
Run: The command is being executed.
Wait: The process waits for a certain event (such as I/O completion or receiving a signal ).
Ready: the process is waiting to be allocated to a processor.
Terminate: the process has been completed.
Each process is represented by a process control block (PCB) in the operating system.
Process status: The status may include new, ready, running, waiting, and stopped.
Program counters: The address of the next command to be executed by the process.
CPU registers: The number and type of registers vary depending on the computer architecture. They include accumulators, index registers, stack pointers, General registers, and other condition code information registers. Like program counters, these status information needs to be saved in case of interruptions, so that the process can continue correctly in the future.
CPU scheduling information: This type of information includes process priority, scheduling queue pointer, and any other scheduling parameters.
Memory Management Information: The base address register and limit register values, page tables, or field tables of this type of information.
Accounting Information: This type of information includes the CPU time, actual use time, time limit, accounting quantity, job or process quantity, etc.
I/O status information: This type of information includes the list of I/O devices allocated to the process and the list of opened files.