FOR FREE MATERIALS

Process State

 

Operation on Process

1. Creation 

2. Scheduling 

3. Executing 

4. Killing/Delete

 

Process State:

When a process is running, it changes the state. This state says the current position of the running process.

 

States of a Process

1. New: When the process created (Secondary Memory).

 

2. Ready: When the process is in the main memory then, it is ready to execute.

 

3. Run: Execution state, working with CPU.

 

4. Block and wait (Main memory): When process busy with I/O Operation. When process working with I/O, it still resides in main memory.

 

5. Termination or completion: When the process is finished then everything of the process will be deleted including Process Control Block (PCB).

 

6.  Suspend Ready (Secondary Memory)When main memory is full and one process with high priority come to load at main memory, then one or less priority process reload to secondary memory, this is called suspend ready (Page In and Page Out) because the process is ready but it is swap to secondary memory.

 

7. Suspend wait and suspend Block (Secondary Memory):

When the main memory is full and one process with high priority comes to load at the main memory, then it is better to replace a process that is waiting or blocked (Busy with I/O), not a running process. This concept is called suspend wait.

 

Here we define the process state as per the Operating System

i) Uni-processor: Only one process can load at main memory and run at a time with CPU. So, there is no ready state because only one process is ready until it is finished.

 

 

ii) Non-preemptive Multiprogramming: More than one process at main memory (Ready State), if one process is busy with CPU, will not be preempted until it is completed or busy with I/O. 

 

 

iii) Preemptive Multiprogramming: Multiple processes can load at main memory (Ready State) and a  process that is running can be preempted by a priority or time-sharing basis.   

 

Fig: 13

 

Degree of multi-programming = Number of the process in main memory

 

The process states are represented in queues

When processes are representing in a state, they are actually represented in queues. And these queues are implemented by a linked list. Actually, we represent each state by queue and it uses PCBs to track the jobs. The PCB contains all of the data about the job needed by the operating system to manage the processing of the job.

 

[As the job moves through the system, its progress is noted in the PCB. The PCBs, not the jobs, are linked to form the queues as shown in Figure 4. Although each PCB is not drawn in detail, the reader should imagine each queue as a linked list of PCBs. The PCBs for every ready job is linked on the READY queue, and all of the PCBs for the jobs just entering the system are linked on the HOLD queue. The jobs that are WAITING, however, are linked together by “reason for waiting,” so the PCBs for the jobs in this category are linked into several queues. For example, the PCBs for jobs that are waiting for I/O on a specific disk drive are linked together, while those waiting for the printer are linked in a different queue. These queues need to be managed in an orderly fashion and that’s determined by the process scheduling policies and algorithms.]

 

Fig: 14