Processes in Linux
In Linux systems, processes
are of great importance. Any application, program, or file that runs on a Linux system is termed as a process
. Linux OS can have multiple processes running at the same time.
- Each process is given a unique
process ID
(orPID
for short). - Each process is allocated a separate block of memory (also known as
address space
) where they run.
States of a Process
At any given time, only one process can run. A process can be in one of the three states below.
- Ready State: When the processes are waiting for the currently running process to end and are ready to be run.
- Blocked State: These processes are waiting for some input or output and are waiting for a certain incident to happen before they can be run.
- Running State: The process is currently being executed.
As soon as the process is created, they immediately go into the ready state. They are stored in a special data structure and wait until the current process finishes executing.