There are three types of process scheduler:
We'll learn about 'Process States' and the many states processes that occur throughout the lifespan of a process in this post. The states that the process can have differed from one Operating System to the next. However, just a few frequent states are depicted in the diagram.
Let's first understand what is a process. The process is defined as any program that goes under execution. One example of creating the process is using the fork() system call. The parent process uses a fork() system call which will create the child process. It is possible that at the same time multiple processes are created and stored in memory.
Whenever the process creation is taking place process is in a new state and when the process gets terminated it is in the terminated state or completed state.
The states of the process are stored in Process Control Block(PCB). PCB is a special data structure that stores information about the process.
Let’s learn about the various states a process can go through in detail in the next section along with the process state diagram.
New State
This is the first state of the process life cycle. When process creation is taking place, the process is in a new state.
Ready State
When the process creation gets completed, the process comes into a ready state. During this state, the process is loaded into the main memory and will be placed in the queue of processes which are waiting for the CPU allocation.
When the process is in the creation process is in a new state and when the process gets created process is in the ready state.
Running State
Whenever the CPU is allocated to the process from the ready queue, the process state changes to Running.
Block or Wait State
When the process is executing the instructions, the process might require carrying out a few tasks which might not require CPU. If the process requires performing Input-Output task or the process needs some resources which are already acquired by other processes, during such conditions process is brought back into the main memory, and the state is changed to Blocking or Wait for the state. Process is placed in the queue of processes that are in waiting or block state in the main memory.
Terminated or Completed
When the entire set of instructions is executed and the process is completed. The process is changed to terminated or completed state.During this state the PCB of the process is also deleted.
It is possible that there are multiple processes present in the main memory at the same time.
Suspend Ready
So whenever the main memory is full, the process which is in a ready state is swapped out from main memory to secondary memory. The process is in a ready state when goes through the transition of moving from main memory to secondary memory, the state of that process is changed to Suspend Ready state. Once the main memory will have enough space for the process, the process will be brought back to the main memory and will be in a ready state.
It’s possible that the process is waiting or blocked state can be swapped out to secondary memory. Let’s understand in which state process in waiting or block state will go.
Suspend Wait or Suspend Blocked
Whenever the process that is in waiting for state or block state in main memory gets to swap out to secondary memory due to main memory being completely full, the process state is changed to Suspend wait or Suspend blocked state.
Let’s conclude what we have learnt so far.
If the process is intensive in terms of CPU operations then it is called CPU bound process. Similarly, If the process is intensive in terms of I/O operations then it is called IO bound process.
Types of schedulers
Multiprogramming: We have many processes ready to run. There are two types of multiprogramming:
Degree of multiprogramming
The number of processes that can reside in the ready state at maximum decides the degree of multiprogramming, example: if the degree of programming = 100, this means 100 processes can reside in the ready state at maximum.
10 videos|99 docs|33 tests
|
1. What is a process scheduler in an operating system? |
2. What are the different states of a process in an operating system? |
3. What is the role of a process scheduler in managing process states? |
4. How does a process scheduler prioritize processes in an operating system? |
5. How does process scheduling impact the performance of an operating system? |
|
Explore Courses for Computer Science Engineering (CSE) exam
|