Operating Systems · Unit 3
Process Management
Exam-focused notes for Process Management (Operating Systems, BIT204): what the TU syllabus asks and how it has actually been tested, with 4 solved past questions from this unit.
Process Management in short
A process is the basic unit of work in an operating system. This chapter explains what a process is, how the OS keeps track of it, and how a process moves between states.
What this unit covers
- Process definition and characteristics
- Program versus process distinction
- Process Control Block
- Process state transitions
- 3-state process model
- 5-state process model
- Context switching
3-state process model
2080 · 5 marks
What is process? Explain 3 state process models with suitable diagram. [5]
Show solved answerHide answer
Process and 3-State Process Model
What is a Process?
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.
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).
Program versus process distinction
2080 · 5 marks
Differentiate between process and a program. What is PCB? [5]
5-state process model
Process state transitions
0 · 5 marks
Explain about the transition between different states of a process. [5]
Make Unit 3 stick
Practice BIT204 with flashcards & quizzes