BIT204 ยท 2080 ยท 5 marks
What is process? Explain 3 state process models with suitable diagram.
What is process? Explain 3 state process models with suitable diagram. [5]
Quick answer
A process is a program in execution. It is an active entity that requires resources such as CPU time, memory, files, and I/O devices to accomplish its task. A process is more than just program code (text section); it also includes the current activity represented by the value of the program counter, processor registers, stack, and data section.
Process and 3-State Process Model
What is a Process?
In simple terms: Program + Execution State = Process
3-State Process Model
As a process executes, it moves through different states. In the 3-state (three-state) process model, a process can be in one of the following three states:
States
| State | Description |
|---|---|
| Running | The process is currently being executed by the CPU. |
| Ready | The process is ready to execute but is waiting for the CPU to be assigned to it. |
| Blocked (Waiting) | The process is waiting for some event to occur (e.g., I/O completion, signal) and cannot proceed until that event happens. |
State Transition Diagram
Dispatch
+--------->---------+
| |
| v
READY RUNNING
^ |
| Timeout/ |
+-------<-----------+
(Preempt) |
| Wait for
| I/O or Event
v
BLOCKED
|
| I/O or Event
| Completes
|
+--------->-----> READY
Explanation of Transitions
-
Ready โ Running (Dispatch)
- The OS scheduler selects the process from the ready queue and assigns the CPU to it.
-
Running โ Ready (Timeout / Preemption)
- The running process is preempted because its time slice (quantum) has expired, or a higher-priority process becomes ready. The process goes back to the ready queue.
-
Running โ Blocked (Wait for I/O or Event)
- The running process requests an I/O operation or waits for an event (e.g., reading from disk). Since it cannot continue, it moves to the blocked state.
-
Blocked โ Ready (I/O or Event Completes)
- When the awaited I/O or event is complete, the process moves back to the ready state and waits for CPU allocation.
Key Points
- Only one process can be in the Running state at a time on a single-processor system.
- Multiple processes can be in the Ready or Blocked state simultaneously.
- A process never goes directly from Blocked to Running; it must pass through Ready first.
- This model forms the foundation for more complex models (5-state, 7-state models).
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.