Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

PROCESSES IN LINUX

Processes in Linux
• Process: Program in execution – It’s a running instance of a program. Made up of the
program instruction, data read from files, other programs or input from a system user.

• Processes in Linux : Running instance of a command. Eg: when you use ls command to
list the directory contents, you started a process.

• A process is identified by a Process ID. Process ID is unique for the current system.

• No other process can use that number as its process ID while that first process is still
running and once a process is ended another process can reuse that number.
States of a process in Linux
• As a process executes it changes state according to its circumstances.

1. Running: The Process is either running or it is ready to run.

2. Waiting(Blocked): The process is waiting for an event or for a resource. 2 types:

• Interruptible and uninterruptible

3. Stopped: Once the process is completed, this state occurs. A process that is being debugged can be in
a stopped state. This process can be restarted.

4. Zombie: This is a halted process or a dead process. The process will be terminated and the
information will still be available in the process table.
Types of Process in Linux
1. Parent and Child Process: parent process creates and manages one or more child processes.
The parent process typically initiates the creation of a child process, and they may communicate
through inter-process communication mechanisms.

2. Zombie Process(or defunct process): It is a terminated child process that still has an entry in
the process table. This entry is necessary for the parent to retrieve information about the
terminated child, like the exit status. Once the parent collects this information, the zombie
process is removed from the process table.
Types of Process in Linux
• 3. orphan process: It is a child process whose parent has terminated. Orphan processes are
adopted by the ‘init’ process, which has process ID 1. ‘init’ becomes the new parent, and it ensures
that orphan processes are reaped and their resources are released.

• 4. Daemon process: It is a background process that runs detached from the terminal. Daemons are
typically started during system boot and perform tasks like handling system services. They are
designed to run continuously, providing specific services to other processes or users.
Process Attributes
❖The process ID: Unique numerical identifier assigned to each running process in an operating system.

❖The parent Process ID: ID of the process that spawned (created) the current process.

❖ Nice number: value that influences the priority of a process in the Linux scheduling algorithm. ranges
from -20 to 19, with lower values indicating higher priority. Negative values mean a higher priority, and
positive values mean a lower priority.

❖ Terminal: Device or location where the process is initiated and controlled. It is the interface through
which a user interacts with a shell or a command-line environment.

❖User name: Name of the user account that owns or initiated the process.

You might also like