GYANEXIS
MIND IN MOTION  |  REWARDS IN HANDS !
gyanexis.com
support@gyanexis.com
Date: ___ / ___ / ______
GYANEXIS

MIND IN MOTION  |  REWARDS IN HANDS !

www.gyanexis.com
support@gyanexis.com
PRACTICE SET

Operating Systems Practice Set 2

Unit 2 · Process Management and CPU Scheduling
Operating Systems
Time: 45 MinutesTotal Marks: 25
Note: Answer all questions. Write your own answer first, then compare it with the answer given below each question.

SECTION A

1.Answer all questions in brief.
2 × 5 = 10
Q.NoQuestionsMarks
(a)

Differentiate between a program and a process.

2
Answer

A program is a passive file of instructions stored on disk. A process is a program in execution: it is active and has a program counter, registers, a stack, a data section and resources such as open files. One program can run as several processes.

(b)

What is a Process Control Block (PCB)? List four of its contents.

2
Answer

The PCB is the data structure the operating system keeps for each process. It holds: process state, process id, program counter, CPU registers, scheduling information (priority, queue pointers), memory-management information, accounting information and the list of open files and I/O devices.

(c)

What is a context switch?

2
Answer

A context switch is the work of saving the state (registers, program counter) of the running process in its PCB and loading the saved state of the next process. It is pure overhead: no useful work is done during it.

(d)

Differentiate between preemptive and non-preemptive scheduling.

2
Answer

In non-preemptive scheduling a process keeps the CPU until it finishes or waits for I/O. In preemptive scheduling the operating system may take the CPU away, for example when a time slice ends or a higher-priority process arrives. Round Robin and SRTF are preemptive; FCFS is non-preemptive.

(e)

What is starvation? How does aging solve it?

2
Answer

Starvation happens when a ready process waits indefinitely because others are always chosen before it, as can happen to low-priority processes in priority scheduling. Aging gradually raises the priority of a process the longer it waits, so it is eventually scheduled.

SECTION B

2.Answer all questions.
5 × 3 = 15
Q.NoQuestionsMarks
(a)

Draw and explain the five-state process model.

5
Answer

States: New (being created) → Ready (waiting for the CPU) → Running (executing) → Terminated (finished). From Running a process may also go to Waiting (blocked on I/O or an event).

Transitions: admitted (New → Ready); scheduler dispatch (Ready → Running); interrupt or time slice over (Running → Ready); I/O or event wait (Running → Waiting); I/O or event completion (Waiting → Ready); exit (Running → Terminated).

Only one process per CPU can be Running at a time; many can be Ready or Waiting, each in its own queue.

(b)

Four processes arrive at time 0 with CPU burst times P1 = 6, P2 = 8, P3 = 7 and P4 = 3 ms. Find the average waiting time under FCFS (order P1, P2, P3, P4) and under SJF.

5
Answer

FCFS: P1 runs 0–6, P2 6–14, P3 14–21, P4 21–24.
Waiting times: P1 = 0, P2 = 6, P3 = 14, P4 = 21. Average = 41 / 4 = 10.25 ms.

SJF (shortest burst first): P4 0–3, P1 3–9, P3 9–16, P2 16–24.
Waiting times: P4 = 0, P1 = 3, P3 = 9, P2 = 16. Average = 28 / 4 = 7 ms.

SJF gives the lower average waiting time; it is the optimal non-preemptive algorithm for this measure.

(c)

Three processes arrive at time 0 with burst times P1 = 24, P2 = 3 and P3 = 3 ms. Using Round Robin with a time quantum of 4 ms, draw the Gantt chart and find the average waiting time and average turnaround time.

5
Answer

Gantt chart: P1 0–4 | P2 4–7 | P3 7–10 | P1 10–14 | P1 14–18 | P1 18–22 | P1 22–26 | P1 26–30.

Completion times: P1 = 30, P2 = 7, P3 = 10.
Turnaround time (completion − arrival): P1 = 30, P2 = 7, P3 = 10. Average = 47 / 3 = 15.67 ms.
Waiting time (turnaround − burst): P1 = 30 − 24 = 6, P2 = 7 − 3 = 4, P3 = 10 − 3 = 7. Average = 17 / 3 = 5.67 ms.

GYANEXIS  •  Mind in Motion, Rewards in Hands !
gyanexis.com
← Operating Systems Practice Set 1Operating Systems Practice Set 3 →All Practice

© 2026 GYANEXIS. All Rights Reserved.