FIT2100 Chap.5 Processes and State Transitions
Processes and State Transitions
A process combines an executing program with its address space, processor context, identity, resource references and scheduling state. Two executions of the same program are distinct because their registers, stacks, memory and open objects differ. The kernel stores management information in a process table, with a process control block for every process.
Running, ready and blocked have precise meanings.
Running owns a processor. Ready can run but awaits selection. Blocked cannot run until an event occurs. Context switching saves one execution context and restores another. Creation, image replacement and termination are separate operations, which matters when reasoning about parent-child relationships and inherited resources.
What this chapter covers
- 01
Program versus process
- 02
Address space and context
- 03
Process control blocks
- 04
Process creation
- 05
Parent and child relationships
- 06
Running, ready and blocked
- 07
Context switching
- 08
Termination causes
Worked example · free
Explain block, switch and resume
- +2The system call enters the kernel, saves P's context and changes P from running to blocked because its event has not occurred.
- +2The scheduler selects ready process Q, restores Q's saved context and returns to user execution in Q.
- +2An input-completion interrupt later moves P from blocked to ready. P becomes running only when the scheduler selects and restores it.
Key terms
- Process
- An executing program together with address space, processor context, resource references, identity and management state.
- Execution Context
- The program counter, registers, status and related processor state needed to continue an execution stream.
- Process Control Block
- The kernel record holding saved context and process-management information.
- Ready State
- The state of a runnable process that awaits processor selection.
- Blocked State
- The state of a process that cannot execute until a required event or resource becomes available.
- Context Switch
- The operation that saves an outgoing execution context and restores the selected incoming one.
Processes and State Transitions FAQ
How is a process different from a program?
A program is executable code and related static data, while a process is one active execution with changing registers, stack, address space, open resources and state. Several processes can run the same program without sharing the same execution context.
Can a ready process execute immediately?
It is eligible but must still be selected by the scheduler and assigned a processor. Another process may continue running, or higher-priority work may be chosen first. Ready and running are therefore not synonyms.
Why does a context switch cost time?
The kernel saves registers and management state, updates process records, chooses another process and restores its context. Switching can also disturb processor caches and translation state, so no application work completes during part of the operation.
Does every error terminate a process?
No. Applications can detect and recover from many errors. Termination occurs after normal completion, an unrecoverable failure, a protection violation or an authorised external request. The cause controls status reporting and cleanup.
Assessment move
Draw a three-state model and annotate every arrow with a triggering event. Practise distinguishing loss of CPU from inability to run. For context switches, recite the order: enter kernel, save, update state, select, restore and return. In code demonstrations, identify which process owns each descriptor and which path parent and child execute.
An output sequence alone cannot prove state; connect the observed behaviour to system calls and events. Create event cards for timer expiry, unavailable input, I/O completion, process creation, normal exit and protection failure. For each card, name the process that experiences the event, its source state, destination state and any scheduler decision that remains separate.
Include deliberately invalid arrows and explain why, such as blocked directly to running without selection. Build a process inventory that separates executable image, address space, CPU context, credentials, descriptors and scheduling fields. Then compare two executions of the same program to identify what can be shared and what must differ.
For context-switch rehearsal, write outgoing and incoming process identifiers beside every saved or restored field; this prevents vague explanations in which state seems to belong to the CPU itself. When studying parent and child behaviour, draw descriptor-reference relationships immediately after creation and after every close or replacement operation.
In a lab, predict several legal output orders instead of one fixed order, and identify the synchronisation or blocking event needed to rule alternatives out. Use system-call results and explicit waits as evidence. Conclude each exercise by naming whether the observation demonstrates creation, eligibility, CPU ownership, waiting or termination; these are related but not interchangeable claims.
Working through Processes and State Transitions in FIT2100? Sia is AskSia’s AI Computer Science tutor — ask any FIT2100 Processes and State Transitions question and get a clear, step-by-step explanation grounded in how FIT2100 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.