tags: operating-system os process program is_child_of: process

What is a process?

A process is a running program which has allocated system resources. In more simpler words, it is a container that holds all the information to run a program.

Process resources

A process contains following resources

  1. Address space
  2. Registers
    1. Program counter
    2. Stack pointer
  3. List of open files
  4. Related processes

Address space

This is the memory allocated to a process where it stores all its data. An address space defines the limit of memory accessing of the process.

Address space consists the program instructions, data, and its stack.

Process table

Operating system maintains a process table having information about all the processes created so far. The table consist information like

  1. List of all the open files and their pointers.
  2. Information about related processes or child processes
  3. Etc.

When a process is suspended, operating system has to save process state and all the information in process table. Address space of process is not stored in process table. That is already preserved in the main memory.

When the process is restarted, operating loads the process information from process table and process continues in the state it left.