In Operating System, the Process refers to an instance of a computer program in execution. The Process includes the current values of the program counter, registers, and variables.
Processes create a fundamental structure of any modern operating system. The general definition of a process is “a program in execution” or “a loaded program and its resources”. It carries the program code and its actions. Based on the OS (Operating System), a process may be the several threads that execute commands simultaneously.
For example, when we want to explore something, we open the web browser and start searching for any topic. This is the Process, and its task is mentioned in the Program.
When the Program is loaded in the memory and starts executing, it is divided into 4 four sections ─ stack, heap, text, and data.
Processes divided into 4 sections
In Process, Stack holds temporary data such as method/function parameters, local variables, and return address.
Heap is the allocated memory to a process during its run time.
Data Contains the static and global variables.
This section includes the current activity of the Program Counter and processor’s registers.
A process has different attributes linked with it. Let’s discuss the some of the attributes of the Process
- Process ID: Every single Process has an ID that is known as the Process ID. This Process ID helps to identify the one Process from the other processes. Also, with the help of this Process ID, we can fetch all details of the Process.
- Process state: Every Process has a state while it is in execution. Process state can be anything like ready, blocked, waiting or running.
- CPU scheduling information: Each Process follow the scheduling algorithms to run the program successfully. Some Scheduling Algorithms are round-robin, SJF, LJF, FCSF etc.
- Input/Output information: The Process requires some input/output devices for execution. So each Process has the information about the required devices and resources. So that during the execution of the program device can be allocated.