Chapter 1 · Operating Systems: Structure and Services
1.3Process Management in Operating System (OS)
How the operating system creates, runs and ends processes, switches between them, and decides their order with FCFS.
Written and checked by Muhammad Raheel(opens in a new tab)
Full Stack Developer · AI Engineer · Reviewed 6 Oct 2026 · 3 min read
On this page
Every program you open needs memory and CPU time to run. The OS looks after all of these running programs, so each one gets what it needs. This job is called process management. It is one of the most important jobs of an OS, because it stops programs from disturbing each other.
Process Life Cycle
Every process passes through three stages:
- Creation: you start a program, like MS Word. The OS loads it into memory and gives it the resources it needs, like CPU time and memory.
- Execution: the process is running and doing its work.
- Termination: the process finishes, or the user or system closes it. The OS takes back its resources, so other processes can use them.
Multitasking and Concurrency
A modern OS makes many processes seem to run at the same time. Two ideas explain this.
Multitasking means one user can keep more than one program open and usable at the same time. You can switch between them whenever you like. For example, you listen to music, keep a document open and browse the internet.
Concurrency means more than one process is active at the same time, but the CPU works on them one by one, in very fast turns.
Process Scheduling Concepts
The CPU can work on only one process at a time. So the OS must decide two things:
- Which process should run first?
- How long should each process run?
This decision is called scheduling. There are many scheduling methods. This book covers one of the simplest: First Come, First Served (FCFS).
FCFS works like a queue at a shop counter. The first customer in line is served first.
Numerical Example
Three processes arrive at the CPU:
| Process ID | Arrival Time | Time Needed | Starts | Finishes |
|---|---|---|---|---|
| P1 | 0 seconds | 5 seconds | 0s | 5s |
| P2 | 1 second | 3 seconds | 5s | 8s |
| P3 | 2 seconds | 2 seconds | 8s | 10s |
P1 arrives first and runs from 0s to 5s. P2 arrives at 1s and waits. P3 arrives at 2s and waits behind both. P2 runs from 5s to 8s, then P3 runs from 8s to 10s.
Look at P3. It needs only 2 seconds, the shortest time of all. But it still waits, because P1 and P2 arrived first.
Advantages and Disadvantages of FCFS
| Advantages | Disadvantages |
|---|---|
| Easy to understand and implement | Short processes may wait a long time behind longer ones |
| Processes are served in the exact order they arrive. No process is skipped. | This "convoy effect" can affect the overall efficiency of the system |
Practice this topic
Short questions
1.Explain one advantage and one disadvantage of FCFS scheduling.2 marks
Answer
From the book: "Advantages: Easy to understand and implement, as processes are served in the exact order they arrive. No process is skipped." "Disadvantages: Short processes may have to wait a long time if they are queued behind longer processes (known as the "convoy effect"), which can affect the overall efficiency of the system."
2.Define multitasking in computer system.2 marks
Answer
From the book: "Multitasking: The operating system allows more than one program to be open and usable by a single user at the same time. You can easily switch between them whenever you need." Example: "You can listen to music, keep a document open, and browse the internet, moving between them as needed."
3.What is a process?2 marks
Answer
From the book: "The operating system is responsible for managing all the programs that run on a computer. In this context, these running programs are called processes." Process management ensures that each process gets the resources it needs, even when multiple processes are active.
4.List the three stages of the process life cycle.2 marks
Answer
Creation, Execution, and Termination.
5.Describe the Creation stage of a process.3 marks
Answer
Creation happens when you start any program (like MS Word). The OS loads the program into memory and gives it the resources (like CPU time and memory) it needs.
6.Define Concurrency with an example.3 marks
Answer
Concurrency is when more than one process is active at the same time in an OS, but the CPU processes them one by one in extremely fast cycles. Example: Like a chef preparing three dishes, working on one for a short time, then moving to the next, and repeating, the CPU switches between processes so rapidly that the user does not notice any delay.
7.What is scheduling in an operating system?3 marks
Answer
Since the CPU cannot run all processes at the same time, the operating system must decide which process should run first and how long each process should run. This process is called scheduling.
8.Define the FCFS scheduling method.3 marks
Answer
In the FCFS (First Come, First Served) method, the CPU processes tasks in the exact order they arrive. The first process to arrive is completed first, and the next process starts only after the previous one finishes.
Long questions
1.Explain the process lifecycle in detail with examples.8 marks
Answer
Cover both parts:
-
The three stages (verbatim):
- Creation: This happens when you start any program (like MS Word). The OS loads the program into memory and gives it the resources (like CPU time and memory) it needs.
- Execution: The process is actively running and performing tasks effectively.
- Termination: The process finishes its task and is closed by the user or the system. The OS frees the resources so they can be used by other processes.
-
Google Chrome lifecycle example (verbatim):
- Creation: Begins when the user clicks the browser icon. The operating system loads the program into memory and allocates the required resources.
- Execution: The browser performs tasks such as loading web pages, displaying media, and responding to user actions.
- Termination: Occurs when the browser is closed. The operating system stops the process and releases its resources for other uses.
Aim for 200-300 words.
-
2.A computer system uses the First-Come, First-Served (FCFS) scheduling method to manage processes. The following table shows the arrival time and the CPU burst time (time needed for execution) of three processes: | Process | Arrival Time (seconds) | Burst Time (seconds) | |---|---|---| | P1 | 0 | 4 | | P2 | 1 | 3 | | P3 | 2 | 1 | Requirements: - I. Arrange the processes in the order they will be executed according to the FCFS scheduling method. - II. Show the execution sequence of all processes. - III. Calculate the start time and completion time for each process. - IV. Find the waiting time for each process. - V. Calculate the average waiting time for all processes.8 marks
Answer
Work it the way the book's numerical example does (topic 1.3, pages 7 to 8): "In the FCFS method, the CPU processes tasks in the exact order they arrive. The first process to arrive is completed first, and the next process starts only after the previous one finishes."
- Order: P1 → P2 → P3 (order of arrival).
- Execution sequence:
[ P1: 0-4] → [ P2: 4-7] → [ P3: 7-8] - Start and completion times: P1 starts 0, completes 4. P2 arrives at 1 but waits; starts 4, completes 7. P3 arrives at 2 but waits; starts 7, completes 8.
- Waiting time = start time - arrival time: P1 = 0 - 0 = 0 s, P2 = 4 - 1 = 3 s, P3 = 7 - 2 = 5 s.
- Average waiting time: (0 + 3 + 5) / 3 = 8 / 3 = 2.67 s (about).
Exam curveball: the book's teaching shows only start and finish times; it never defines "waiting time" or "average waiting time". Learn the two steps above. P3 needs only 1 second but waits the longest (5 s): the book's Observation, "shorter tasks can be delayed if they arrive after longer ones" (the "convoy effect").
Aim for full working shown (order, timeline, table, waiting times, average).
3.Differentiate between multitasking and concurrency with examples from the book. State how they help modern operating systems.8 marks
Answer
Structure the answer in three parts:
-
Multitasking (verbatim): "The operating system allows more than one program to be open and usable by a single user at the same time. You can easily switch between them whenever you need." Example: "You can listen to music, keep a document open, and browse the internet, moving between them as needed."
-
Concurrency (verbatim): "More than one process is active at the same time in an OS, but the CPU processes them one by one in extremely fast cycles." Example: "Like a chef preparing three dishes, working on one for a short time, then moving to the next, and repeating, the CPU switches between processes so rapidly that the user does not notice any delay."
-
How they help (verbatim link): "Modern operating systems can manage many processes so efficiently that it appears they are all running at the same time."
Aim for 200-300 words.
-
4.Solve the FCFS scheduling problem for these processes and explain each step: | Process | Arrival Time | Time Needed | |---|---|---| | P1 | 0 seconds | 5 seconds | | P2 | 1 second | 3 seconds | | P3 | 2 seconds | 2 seconds | Draw the execution timeline. State one advantage and one disadvantage of FCFS, and explain the "convoy effect" using this example.8 marks
Answer
Follow the book's step-by-step exactly:
-
Step-by-Step Explanation (verbatim):
- At 0 seconds: P1 arrives first, so it starts running immediately. It requires 5 seconds to finish. It runs from 0s to 5s.
- At 1 second: P2 arrives while P1 is still running, so P2 waits.
- At 2 seconds: P3 arrives, but P1 is still running and P2 is already waiting. In FCFS, P3 will also wait until both P1 and P2 have completed.
- At 5 seconds: P1 finishes. The CPU now starts P2, which needs 3 seconds to complete. P2 runs from 5s to 8s.
- At 8 seconds: P2 finishes. The CPU now starts P3, which needs 2 seconds. P3 starts and runs from 8s to 10s.
-
Execution Timeline (draw):
[ P1: 0-5] → [ P2: 5-8] → [ P3: 8-10], total 10 seconds. -
Observation (verbatim): Even though P3 has the shortest duration (only 2 seconds), it must still wait until P1 and P2 have finished because they arrived earlier. This is one of the main characteristics of FCFS; shorter tasks can be delayed if they arrive after longer ones.
-
Advantages + Disadvantages (verbatim): Advantages: Easy to understand and implement, as processes are served in the exact order they arrive. No process is skipped. Disadvantages: Short processes may have to wait a long time if they are queued behind longer processes (known as the "convoy effect"), which can affect the overall efficiency of the system.
-
Convoy effect using this example: P3 is the shortest task (2 seconds) but arrives last. It cannot start until 8s because P1 (5s) and P2 (3s) arrived earlier: "Short processes may have to wait a long time if they are queued behind longer processes".
Aim for 300-450 words.
-