operating-systems

Definition

Process

A process is an instance of a program in execution. It consists of the program’s code together with its current execution state and allocated resources.

Program and process

A program is static code stored on disk. A process is the dynamic execution of that code. The same program can give rise to multiple processes.

Components

Code

The code is the program’s machine instructions.

Execution State

The execution state includes the program counter, registers, stack pointer, and status word.

Memory

The process uses its own address space, including the text, data, stack, and heap.

Resources

The process may hold open files, devices, sockets, and other kernel-managed resources.

The operating system stores this information in a process control block.

Lifecycle

The operating system creates, schedules, suspends, and terminates processes. During termination, special cases such as zombie processes and orphan processes can occur.