Every Unit I question from the six 2023–2025 papers in OS Akash.pdf, plus
older-paper questions for syllabus points those six never asked. Answers are sized to the marks that
were actually printed on the question.
A. What is an Operating System
Introduction
Unit I · Introduction
Explain operating system and its functions. What is the difference between a process and a program?
Recent PYQ — must doEnd Term Dec 2025 · Q.2(a)3 MarksVery high
Show answer
An Operating System is system software that acts as the interface between
the user and the computer hardware. It manages the hardware and software resources of the
system and provides services to application programs, so programs never touch hardware
directly. Examples: Microsoft Windows, Linux, macOS, Android.
Functions of an OS
#
Function
What the OS actually does
1
Process management
Creates, schedules and terminates processes; allocates CPU time.
2
Memory management
Allocates and frees main memory; tracks usage; supports paging and segmentation.
3
File management
Creates, deletes and organises files and directories; controls access permissions.
4
Device management
Controls I/O devices (keyboard, mouse, printer, disk) through drivers.
5
CPU scheduling
Decides which process gets the CPU and for how long; improves utilisation.
6
Security and protection
User authentication, access control, protection from unauthorised access.
Process vs program
A program is a passive set of instructions stored on disk. When the user
runs it, the OS loads it into main memory and creates a process — a program in
execution, an active entity with a program counter, registers, stack and allocated
resources.
Basis
Program
Process
Nature
Passive entity
Active entity
Lives in
Disk / SSD
Main memory + a PCB
Lifetime
Until the file is deleted
Created → terminated
Resources
None allocated
CPU time, memory, files, devices
One file → many?
Single file
Many processes from the same program
Example from the book: MS Word installed on your computer is a program; when
you open it and it starts running, it becomes a process.
Unit I · Introduction
Discuss the services provided by the operating system.
Recent PYQ — must doEnd Term Jan 2024 · Q.2(a)4 MarksHigh
Show answer
Program execution — loads the program into memory and decides the order
of execution using a scheduling algorithm (FCFS, SJF, …). When two programs become ready it
keeps them from interfering, and it also handles deadlock.
I/O operations — manages input/output and communicates with device
drivers so a program can read or write without knowing how the hardware works, and keeps
devices in sync.
Communication between processes — transfers data between processes; when
they are on different machines joined by a network, the OS manages that too.
File management — grants file access, enforces read-only / read-write
permissions, and decides how data is stored and retrieved on disk.
Memory management — checks whether enough free space exists before
loading a program, allocates it at a suitable location, and stops a program using memory
that is not its own.
Exam tipFor 4 marks, five headings plus one line each is a full answer.
Underline the verbs — loads, drivers, network, permissions,
allocates.
B. Types of Operating Systems
Introduction
Unit I · Types of OS
How does multiprogramming differ from multitasking?
Recent PYQ — must doMid Term Nov 2023 · Q.1(a)2 MarksVery high
Show answer
Multiprogramming increases CPU utilisation by organising jobs (code and
data) in main memory so the CPU always has one to execute; if the running job goes for I/O, the
CPU is assigned to another job. Multitasking is a logical extension of it —
the ability of an OS to execute more than one task simultaneously on a CPU, with those
tasks sharing common resources such as CPU and memory.
Basis
Multiprogramming
Multitasking
Aim
Keep the CPU busy
Make progress on several tasks at once
Switch trigger
Running job needs I/O
Time slice ends, even if CPU-bound
CPU count
Single CPU, jobs take turns
One or more CPUs
Relation
The base idea
Extension of multiprogramming
One-liner to open with: “Multiprogramming keeps several jobs in memory so the
CPU is never idle; multitasking keeps several tasks running at once by switching very fast.”
Unit I · Types of OS
Distinguish between batch systems and time-sharing systems.
Recent PYQ — must doEnd Term Jan 2024 · Q.1(a)3 MarksVery high
Show answer
Batch OS — popular in the 1970s. Jobs with similar requirements are grouped
and executed as a batch to speed up processing. Users do not interact with the computer
directly: each prepares a job on an offline device such as a punch card and hands it to the
operator, who sorts similar programs into batches.
Time-sharing OS — uses CPU scheduling and multiprogramming to give each
user a small portion of a shared computer. Each user has at least one program in memory; a
program runs a short time before finishing or requesting I/O. That interval is the
time slice / time slot / quantum, typically 10–100 ms.
Differentiate between Multiprogramming, Multiprocessing and Multitasking operating system.
Recent PYQ — must doEnd Term Dec 2024 · Q.2(c)5 MarksVery high
Show answer
Multiprogramming — one or more programs are loaded in main memory ready to
execute, but only one is on the CPU at a time. If the running program starts an I/O task (which
by definition does not need the CPU), the OS may interrupt it and give control to another
ready program — a context switch. No CPU time is wasted waiting for I/O. The goal is to
keep the CPU busy as long as processes are ready. The OS must also protect each program's memory
area from the others, and must handle programs that do not fit in memory at once — solved by
paging and virtual memory.
Multiprocessing — refers to the hardware: more than one CPU (cores
on one die, or several packages). Several programs execute at the same instant. A system can be
both multiprogrammed and multiprocessed.
Multitasking — the general modern term for running multiple programs,
processes, tasks or threads at the same time when they share a common processing resource. At
any instant the CPU executes one task only; the illusion of parallelism comes from reassigning
the CPU so quickly (a fair share called a quantum) that all seem to run together. A
task here is often a “thread of execution”, not a whole application.
Basis
Multiprogramming
Multiprocessing
Multitasking
Describes
Memory + CPU scheduling policy
Hardware capability
Execution model of a modern OS
CPU count
Usually one
Two or more
One or more
Switch when
Running job needs I/O
Each CPU runs its own job
Quantum expires or task blocks
True parallelism
No
Yes
Only with more than one CPU
Main goal
Keep CPU busy
Add computing power
Fairness and responsiveness
Hook: multiprogramming = many programs in memory ·
multiprocessing = many processors · multitasking = many tasks in time. Both
multiprogramming and multitasking systems are CPU time-sharing systems.
Unit I · Types of OS
What are Real-Time Systems, and why are they critical in certain applications?
Recent PYQ — must doMid Term Oct 2024 · Q.1(a)2 MarksFirst Term Feb 2019 · Q.1(a)Very high
Asked in: Mid Term Oct 2024 Q.1(a) (2) · First Term Feb 2019 Q.1(a)
(2) · and inside Oct-2024 Q.4(a), Oct-2025 Q.4(a), Dec-2025 Q.1(b). The Oct-2024 print says
“Refer Q.1(a) End Term Exam 2019 (Pg no. 1-2019)” — that page is the Feb-2019 First Term paper.
Show answer
A real-time system is an OS designed to respond to events within a strict
time limit (a deadline). Correctness depends on both the result and the time
at which the result is produced. Such systems are like super-fast computers that handle tasks
needing quick responses.
Two types
Hard real-time — missing a deadline is unacceptable; “like urgent
missions, they must be done exactly on time or something really bad could happen”.
Examples: aircraft control systems, pacemakers, nuclear power plant control systems.
Soft real-time — important, but occasional late responses are tolerable.
Examples: multimedia streaming, online gaming, video conferencing.
Working of an RTOS
External events generate interrupts.
The RTOS immediately schedules the highest-priority task.
Tasks are executed within predefined deadlines.
Why they are critical
Application area
Why real-time is critical
Medical devices
Prevent harm or death
Industrial automation
Ensure precision and safety
Military / defence
Timely response in critical situations
Traffic control
Avoid accidents and ensure smooth flow
Telecommunications
Maintain low latency and high availability
Full-marks chain for a 5-mark versionDraw four boxes —
Sensor detects obstacle → Interrupt generated → RTOS schedules braking task → Vehicle stops
immediately — then list advantages (predictable response time, high reliability, efficient
task scheduling, suits mission-critical applications) and disadvantages (expensive development,
complex design, limited flexibility, higher hardware requirements).
Unit I · Types of OS
Differentiate between Time Sharing Systems and Real Time Systems.
Recent PYQ — must doEnd Term Dec 2025 · Q.1(b)5 MarksVery high
Show answer
Basis
Time-sharing system
Real-time system
Objective
Provide quick response and fair CPU sharing among multiple users
Complete tasks within strict deadlines
Response time
Fast, but not guaranteed
Deterministic and guaranteed within a specified time
Scheduling
Uses time slices (quantum) to share CPU among users/processes
Uses priority-based scheduling to meet deadlines
Applications
Multi-user systems, UNIX, online terminals
Air traffic control, medical devices, industrial automation
Deadline requirement
Missing a response time is usually acceptable
Missing a deadline may cause system failure
Focus
User convenience and resource sharing
Timely and predictable task execution
Example
Linux server serving multiple users simultaneously
Car airbag control that must deploy immediately during a collision
Unit I · Types of OS
Explain in detail Multiprogramming, Time Sharing, and Real-Time Operating Systems. Also mention their advantages and disadvantages in brief.
Recent PYQ — must doMid Term Oct 2025 · Q.4(a)5 MarksVery high
Show answer
1. Multiprogramming OS
Keeps multiple programs in main memory at the same time and executes them concurrently. When
one process waits for I/O, the CPU switches to another, ensuring maximum CPU utilisation.
Working: several jobs are loaded into memory → the CPU executes one job → if that
job needs I/O it is put into a waiting state → the CPU is assigned to another ready job → this
continues until all jobs complete.
Example: Program A waiting for I/O, Program B running on CPU, Program C in the ready
queue. When B finishes or waits for I/O, the CPU switches to C.
Advantages: better CPU utilisation · increased throughput · reduced CPU idle
time · efficient use of system resources. Disadvantages: complex memory management · requires CPU scheduling · possibility
of deadlocks · longer response time for users.
2. Time-sharing OS
Allows multiple users or processes to share the CPU simultaneously by allocating a small time
slice (quantum) to each.
Working: CPU divided into small time slices → each process gets a fixed quantum →
when the quantum expires the CPU switches to the next process → switching is so fast that users
feel they have exclusive access.
Example: with quantum = 2 ms, P1 → P2 → P3 → P1 → P2 → P3; each process gets CPU
time round-robin. Applications: multi-user systems · online reservation systems · shared computing
environments.
Advantages: fast response time · supports multiple users simultaneously ·
fair CPU allocation · efficient resource sharing. Disadvantages: frequent context-switching overhead · requires more memory ·
security and data-integrity issues · performance may degrade with many users.
3. Real-Time Operating System (RTOS)
Designed to respond to events within a strict time limit (deadline); correctness depends on
both the result and when it is produced. Hard RTOS — missing a deadline is unacceptable
(aircraft control, pacemakers, nuclear plant control). Soft RTOS — occasional misses acceptable
(streaming, online gaming, video conferencing).
Advantages: predictable response time · high reliability · efficient task
scheduling · suitable for mission-critical applications. Disadvantages: expensive development · complex design · limited flexibility ·
higher hardware requirements.
Comparison
Feature
Multiprogramming
Time-sharing
Real-Time OS
Main goal
Maximise CPU utilisation
Provide quick user response
Meet deadlines
Users
Single or multiple
Multiple users
Usually dedicated systems
CPU allocation
When a process waits
Fixed time quantum
Priority-based scheduling
Response time
Moderate
Fast
Deterministic
Examples
Batch processing systems
UNIX, Linux
VxWorks, QNX, RTLinux
Priority
CPU utilisation
User interaction
Deadline satisfaction
Unit I · Types of OS
Explain the features of parallel systems and distributed systems.
Older PYQ — syllabus gapEnd Term May 2016 · Q.2(a) (5) · End Term Jun 2019 · Q.2(a) (5)Medium
Show answer
Why this is here“Parallel Systems” and “Distributed Systems” are named
in your Unit I syllabus but are not asked in any of the six 2023–2025 papers.
These older questions are the only PYQ evidence for them.
Parallel systems
More than one processor inside one computer system, closely coupled.
Tightly coupled — processors share main memory and a clock (symmetric or
asymmetric multiprocessing); loosely coupled — each has its own memory.
Extra reliability: if one processor fails, the others take over its work at reduced speed
(graceful degradation / fail-safe mode).
Higher throughput than a single processor for the same load.
Distributed systems
Several independent machines with their own memory and CPU, joined by a network —
loosely coupled.
Resources (files, printers, CPU cycles) are shared across sites; the user sees one logical
system.
Communication happens by message passing, not shared memory.
Benefits: load sharing, easy expansion, faster problem solving, site-failure tolerance.
Costs: needs a protocol stack, weaker security model, no single global clock.
Basis
Parallel
Distributed
Coupling
Tightly coupled
Loosely coupled
Memory
Shared main memory
Private memory per node
Communication
Direct memory access
Message passing over a network
Clock
Common clock
No common clock
One unit fails
System continues, slower
That node lost, rest continue
The 2019 print reads “Compare and Constrain Network, Parallel and distributed
operating systems” — Constrain is the book's typo for contrast. Reproduced as
printed so you recognise it.
Unit I · Types of OS
What are personal-computer systems?
Syllabus only — no direct PYQCover for safety
Show answer
Why this is hereIn your syllabus; not asked in either book. One
paragraph is enough insurance.
A personal-computer system is a single-user microcomputer system. Its OS
exists mainly to maximise user rather than system performance, because CPU and memory
are cheap and the human is the bottleneck. Programs are run directly by the user, and most such
systems historically were not designed to run multiple programs at once. Windows, macOS and
desktop Linux provide a GUI, support applications and games, and give the user direct control of
the hardware.
C. OS as a Resource Manager
Introduction
Unit I · OS as Resource Manager
Explain the statement: OS – A Resource Manager.
Recent PYQ — must doEnd Term Dec 2024 · Q.1(a)5 MarksVery high
Show answer
The OS acts as a manager of the hardware and software resources of a computer. Those
resources include CPU (processor), memory (RAM), disk storage, input/output devices,
files and data, and processes and programs. The OS decides who gets
what, how much and for how long, so that all programs and users get
fair and efficient access without conflict or waste.
Functions as a resource manager
Resource
OS role
CPU
Schedules which process runs and for how long (CPU scheduling)
Memory
Allocates and deallocates memory space to processes; protects one from another
Disk
Manages file storage, read/write operations and disk-space allocation
I/O devices
Controls access to printers, keyboards, network cards etc.
Processes
Manages process creation, termination, synchronisation and communication
Every allocation request passes through three OS actions: decide (is the
resource free and is the request legal?), record (update the table saying who
holds what), and release (return the resource when the process finishes or
blocks).
Unit I · OS as Resource Manager
What resources are typically managed by an operating system?
Recent PYQ — must doMid Term Oct 2024 · Q.1(b)2 MarksVery high
Show answer
Resource
Managed function
CPU
Scheduling and execution of processes
Main memory (RAM)
Allocation, protection and swapping
Storage devices
File systems, read/write operations
Files & file system
File access, naming, permissions
I/O devices
Communication, buffering, device drivers
For 2 marks the table plus one closing line is enough: “The OS is the arbiter —
it grants, tracks and reclaims each resource so no two processes use the same one at the same
time.”
D–F. Processes, Process States & Process Management
Processes
Unit I · Processes
Define Process. Explain the lifecycle / various states of a process with a suitable diagram. Discuss how PCBs are used in context switching.
Recent PYQ — must doMid Term Nov 2023 · Q.4(a)Mid Term Oct 2025 · Q.2(a)4–5 MarksVery high
Asked in: Mid Term Nov 2023 Q.4(a) · Mid Term Oct 2025 Q.2(a) (4 marks,
where it is merged with PCB and context switching) · End Term May 2016 Q.3(c). One answer covers all.
Show answer
Definition
A process is a program in execution — an active entity needing CPU time,
memory, files and I/O. The objective of multiprogramming is to have some process running
at all times to maximise CPU utilisation; the objective of time sharing is to switch the
CPU among processes so frequently that users can interact with each program while it runs. To
meet these objectives the process scheduler selects an available process (from
the set of several available processes) for program execution on the CPU.
On a single-processor system there will never be more than one running process;
if there are more processes, the rest must wait until the CPU is free and can be rescheduled.
Five states
New — the process is being created.
Ready — admitted to memory, waiting only for CPU time.
Running — instructions are being executed.
Waiting / Blocked — waiting for an event other than CPU (I/O completion, a signal).
Terminated — finished; the OS reclaims its resources.
Fig D-1 · Process state transition diagram
How to draw this in exam
Four ovals in a row across the top: New · Ready · Running · Terminated.
One more oval, Waiting/Blocked, below and between Ready and Running.
Label the straight arrows: admitted, scheduler dispatch, exit.
Add the curved pair: Running → Waiting (“I/O or event wait”) and Waiting → Ready (“I/O or event completion”).
Finish with Running → Ready labelled “interrupt / preemption”.
Extended (seven-state) version
Transition
Cause
New → Ready
Admitted by the long-term scheduler
Ready → Running
Short-term scheduler dispatches
Running → Ready
Time quantum expired / interrupt / preempted by higher priority
Running → Waiting
I/O request or an event the process must wait for
Waiting → Ready
I/O or event completion
Ready → Suspended-Ready
Medium-term scheduler swaps the process out to free memory
Suspended-Ready → Ready
Swapped back in when memory frees up
Running → Terminated
Normal exit or forced termination
How the PCB is used in a context switch
A timer interrupt or quantum expiry stops the running process.
The OS saves the CPU registers and program counter into that process's PCB and sets its state to ready (or waiting).
The scheduler picks the next process and reads its PCB.
The OS restores registers and program counter from the new PCB, sets the state to running and jumps to the restored address.
Explain Process Control Block (PCB). Draw the block diagram of process control block / process transition states.
Recent PYQ — must doEnd Term Jan 2024 · Q.2(b)6 MarksMid Term Oct 2024 · Q.2(a)5 MarksVery high
Asked in: End Term Jan 2024 Q.2(b) (6) · Mid Term Oct 2024 Q.2(a) (5).
The Oct-2024 print says “Refer Q.2(b) End Term Exam January 2024 (Pg no. 8-2023)” — same question.
Also Jul-2023 Q.1(c) and Jul-2016 Q.1(c).
Show answer
A Process Control Block (PCB) — also called a process descriptor or task
control block — is the data structure the OS uses to store everything it needs about one
process. With the creation of a process a PCB is created, which controls how that process is
being carried out. Its aim is to help the OS manage the enormous number of tasks being carried
out: the OS creates a PCB for every process, and it contains all the important information about
that process, which the OS later uses to manage and run processes efficiently.
Stored in the PCB so the OS can manage and schedule the process — “running”, “waiting”, “ready” or “terminated”.
Process ID
A unique number the OS assigns as soon as the process is created; distinguishes processes from one another.
Program counter
Address of the next instruction to execute. On a context switch the current value is saved here so execution resumes exactly where it left off.
CPU registers
Accumulators, index registers, stack pointer. The PCB keeps a copy so register state can be restored.
Memory information
Base address / limit registers, page table, segment table — helps the OS allocate memory to the process efficiently.
Process scheduling information
Priority and the algorithm state, stored in the PCB to help the OS make scheduling decisions.
Accounting information
CPU time used, memory used, time limits — helps the OS monitor the performance of the process.
Line that earns the mark“The PCB is the OS's bookkeeping record for a
process; without it a process could be suspended and never correctly resumed.”
Unit I · Processes / Threads
Differentiate between Process and Thread. Describe the process and thread with a suitable example.
Recent PYQ — must doEnd Term Dec 2024 · Q.2(a)4 MarksMid Term Oct 2025 · Q.1(c)2 MarksHigh
Asked in: End Term Dec 2024 Q.2(a) (4) · Mid Term Oct 2025 Q.1(c) (2) ·
First Term Feb 2019 Q.1(c) (2). One table covers all three.
Show answer
A process is an independent program in execution with its own address space.
A thread is the smallest unit of CPU execution within a process — a
lightweight process. One process may contain several threads that share the same code, data and
resources but execute independently.
Example
Process: open a web browser, a music player and a text editor — three separate processes.
Thread: inside the one browser process, one thread draws the user interface, one downloads pages, one plays video.
Aspect
Process
Thread
Definition
An independent program in execution
A lightweight unit of execution within a process
Memory space
Each process has its own separate memory space
Threads of the same process share memory and resources
Communication
IPC is complex and slower (needs the kernel)
Threads can easily communicate with each other (shared memory)
Overhead
High — more resources needed to manage processes
Low — threads are more efficient and lightweight
Creation time
Creating a process is slower
Creating a thread is faster
Context switch
Slower — address space must be swapped
Faster — only registers and stack change
Own resources
PCB, code, data, heap, stack, file table
Only its stack, program counter and register set
Failure effect
Crash is isolated to that process
A crashing thread can bring down the whole process
G. Interrupts
Processes
Unit I · Interrupts
What is an interrupt? Explain its types and the role of an interrupt handler.
Syllabus only — no direct PYQCover for safety
Show answer
Why this is here“Interrupts” is named in the Unit I syllabus but is not
asked as a standalone question in either book. It appears inside other answers (I/O completion,
the timer that ends a quantum, preemption), so learn the short version.
An interrupt is a signal to the CPU that some event needs attention. The CPU
suspends the current instruction stream, saves just enough state to come back, and jumps to a
kernel routine that services the event. Interrupts are how the OS gets control without the
program's cooperation — without them there would be no preemption, no I/O completion and no
time sharing.
Type
Source
Examples
Hardware / external interrupt
A device outside the CPU
I/O completed, timer tick, key pressed
Machine-check interrupt
CPU or memory hardware
Parity error, power failure
Trap (software interrupt)
The running instruction itself
system() call, divide by zero, page fault, invalid opcode
What the handler does
The device raises the interrupt line; the CPU finishes the current instruction.
The CPU saves the program counter and flags on the kernel stack.
The interrupt vector — a table of handler addresses — is indexed by the interrupt number to find the right interrupt service routine.
The ISR services the device and, for an I/O interrupt, moves the waiting process from waiting to ready in its PCB.
On return the OS may run the scheduler; if a higher-priority process is now ready, a context switch happens instead of returning to the interrupted process.
H. Interprocess Communication
Processes
Unit I · IPC
What are the advantages of inter-process communication? How does communication take place in a shared-memory environment?
Recent PYQ — must doEnd Term Jan 2024 · Q.4(a)7.5 MarksVery high
Show answer
Advantages of IPC
Enables processes to communicate with each other and share resources, leading to increased efficiency and flexibility.
Facilitates coordination between multiple processes, leading to better overall system performance.
Allows the creation of distributed systems that can span multiple computers or networks.
Can be used to implement various synchronisation and communication protocols such as semaphores, pipes and sockets.
Shared memory vs message passing
Basis
Shared memory
Message passing
How data moves
Both processes map the same region of their address space onto one physical region, then read/write it directly
A sends a message; the OS copies it into the receiver's space
Speed
Fast for large amounts of data — no kernel copy per exchange
Slower for bulk data; every send/receive is a system call
Setup
Region must be created, attached and its size agreed in advance
No setup beyond a channel
Synchronisation
Must be done by the processes themselves (semaphores / mutex) — race conditions are the main hazard
Provided by the OS inside send/receive
Best for
Many small exchanges between processes on the same machine
Two processes share a common buffer. The producer puts items in; the consumer takes them out.
The unbounded-buffer version places no limit on size, so the producer never
waits. The bounded-buffer version allows at most n items, so the
producer must wait when the buffer is full and the consumer must wait when it is empty — and
because both touch the buffer at the same time, access must be mutually exclusive.
semaphore mutex = 1; // protects the buffer
semaphore full = 0; // number of filled slots
semaphore empty = n; // number of free slots
Producer Consumer
while (true) { while (true) {
produce an item; wait(full);
wait(empty); item = remove from buffer;
wait(mutex); signal(mutex);
add item to buffer; signal(empty);
signal(mutex); consume the item;
signal(full); }
}
Explain the various types of inter-process communication. Give an illustration for each.
Older PYQ — important variantEnd Term May 2016 · Q.4(a) (6) · End Term May-June 2018 · Q.1(a)High
Show answer
IPC mechanism
How it works
Illustration
Shared memory
OS creates a region mapped into both address spaces; processes read/write it directly
Producer and consumer sharing a circular buffer of n slots
Pipes
Unidirectional byte stream; one process writes at the write end, another reads at the read end
ls | wc -l in a shell
Message queues
Kernel keeps a linked list of typed messages; processes send/receive by key
A logging daemon collecting messages from many services
Sockets
Two-way endpoint identified by IP + port; works across machines
A browser talking to a web server over TCP
Signals
Async notification delivered to a process, which runs its handler
Ctrl+C sending SIGINT
Memory-mapped files
A file mapped into memory so two processes see the same bytes
Two editors sharing one config file
The 2018 paper asks this as a comparison of IPC with mutual exclusion — the
shared-memory row is the answer to both framings.
I–K. Threads, Thread Operation & Threading Models
Threads
Unit I · Threads
State the life-cycle of a Thread.
Recent PYQ — must doEnd Term Jan 2024 · Q.1(b)3 MarksVery high
Show answer
In a process, a thread refers to a single sequential activity being executed;
these activities are also known as threads of execution or thread control. Any OS process can
execute a thread, so a process may have multiple threads. When a thread moves through the system
it is always in one of five states (excluding the CREATION and FINISHED end
points): 1. Ready · 2. Running · 3. Waiting · 4. Delayed · 5. Blocked.
How a thread moves between them
When an application is to be processed, it creates a thread.
Required resources (for example a network) are allocated to it and it enters the READY queue.
The thread scheduler (like a process scheduler) assigns it a processor — it enters RUNNING.
If the thread needs some external event to be triggered first (another process completing), it moves RUNNING → WAITING.
A thread that can deliberately sleep for a fixed time moves RUNNING → DELAYED. Example: the snooze function of an alarm — after it rings once and is not switched off, it rings again after a set interval; during that interval the thread is put to sleep.
If the thread generates an I/O request and cannot move further until it is done, it moves RUNNING → BLOCKED.
After the process is completed, the thread moves RUNNING → FINISHED.
Exam tipDraw Creation → Ready → Running → Finished as a straight line of
four boxes, hang Waiting / Delayed / Blocked below Running, and add one dashed arrow from each
back to Ready. Full version →
Diagram Bank · Thread life-cycle.
Unit I · Thread Operation
What are threads? What is the difference between user-level threads and kernel-level threads? Under what circumstances is one better than the other?
Recent PYQ — must doEnd Term Dec 2024 · Q.2(a)4 MarksEnd Term Dec 2025 · Q.3(a)5 MarksEnd Term Jul 2023 · Q.5(a)Very high
Asked in: Dec-2024 Q.2(a) (4) · Dec-2025 Q.3(a) (5) · Jul-2023 Q.5(a) (6).
The Dec-2025 print also asks the “under what circumstances is one better” half, which is the
Situation / Better Choice / Reason table at the end of this answer.
Show answer
A thread is the smallest unit of CPU execution within a process. A process may
contain one or more threads that share the same memory, code and resources but execute
independently. Example: in a web browser, thread 1 = user interface, thread 2 = downloading web
pages, thread 3 = playing video — all belonging to the same browser process.
User-Level Threads (ULT)
Managed by a thread library in user space, without direct support from the OS
kernel. Thread creation and management are done by the user-level library; the kernel is unaware
of these threads.
Characteristics: faster to create and switch; low overhead; portable across operating systems.
Disadvantages: if one thread performs a blocking system call the entire process may block, because the kernel sees only one process; cannot fully utilise multiple CPUs.
Kernel-Level Threads (KLT)
Managed directly by the operating system kernel, which schedules each thread
independently. Each thread is known to the OS.
Advantages: one blocked thread does not block the entire process; better support for multiprocessor systems; true parallel execution is possible.
Disadvantages: thread creation and switching are slower; higher overhead due to kernel involvement.
Related short question (Jun 2019 Q.4(c)): a thread needs only a stack, program
counter and register set when created; a process needs all of that plus its own address
space, page table, file table and PCB.
Unit I · Threading Models
How does the many-to-one model differ from the one-to-one model? Explain the threading models.
Older PYQ — syllabus gapEnd Term May 2016 · Q.1(e)3 MarksMedium
Show answer
Status“Threading Models” is named in your syllabus. Only the
many-to-one vs one-to-one pair has ever been asked (May 2016); many-to-many has no PYQ at
all in either book, so learn the third model for completeness. The visual comparison is
on Diagram Bank · Threading models.
Model
Mapping
Advantage
Limitation
Many-to-One
Many user-level threads → one kernel thread
Thread management is done by the thread library in user space, so it is efficient; works on an OS without kernel thread support
The entire process blocks if one thread makes a blocking system call; only one thread can access the kernel at a time, so threads cannot run in parallel on multiprocessors
One-to-One
Each user thread → its own kernel thread
Provides more concurrency than many-to-one — another thread can run when one makes a blocking call; multiple threads run in parallel on multiprocessors
Every user thread costs a kernel thread, so creation is expensive and the thread count must be limited
Many-to-Many
Many user threads → a smaller or equal pool of kernel threads
Combines both: several threads can run in parallel and creating many user threads is cheap; the OS can give a process more kernel threads when it needs more CPU
Most complex to implement; needs careful scheduling between the two levels
Two-tier (variant)
Some threads 1:1, the rest multiplexed onto kernel threads
Practical compromise used by some systems
Only the bounded number of kernel threads can run in parallel
L–N. Processor Scheduling Theory
Scheduling
Unit I · Scheduling Levels
Describe short-term, medium-term and long-term scheduler. Draw the queueing-diagram representation of process scheduling and differentiate the three schedulers.
Recent PYQ — must doEnd Term Jan 2024 · Q.2(c)5 MarksMid Term Oct 2024 · Q.1(e)2 MarksEnd Term Dec 2024 · Q.3(b)6 MarksVery high
Asked in three of the six recent papers — Jan-2024 Q.2(c), Oct-2024
Q.1(e), Dec-2024 Q.3(b). Learn all three parts together.
Show answer
Process scheduling is the activity of the process manager that removes the
running process from the CPU and selects another process based on a particular strategy. It is an
essential part of a multiprogramming operating system: such systems allow more than one process
to be loaded into executable memory at a time, and the loaded processes share the CPU using
time multiplexing.
The three schedulers
| Scheduler | Role | Frequency | Speed |
Scheduler
Main role
Frequency
Speed / focus
Long-Term (Job scheduler)
Admits processes from the new queue into the ready queue; controls the degree of multiprogramming
Selects which ready process gets the CPU next and dispatches it
Very frequent — milliseconds
Must be very fast; maximises CPU utilisation
Medium-Term (Swapper)
Swaps processes out of main memory and later back in, to reduce multiprogramming under memory pressure
Occasionally
Medium speed; memory management
Aspect
Long-Term
Short-Term
Medium-Term
Alternate name
Job scheduler
CPU scheduler
Swapper
Main role
Admits processes to the system
Selects process for CPU
Swaps processes in / out of RAM
Execution frequency
Infrequent
Very frequent (ms)
Medium
Controls
Multiprogramming level
CPU utilisation
Memory load
Location in diagram
Between new and ready
Between ready and running
Between ready/suspend and ready
Why a long-term scheduler may not existIn time-sharing systems the
long-term scheduler is often absent — every user is already “admitted”, so admission control is
done by the human logging in.
Define the difference between preemptive and non-preemptive scheduling. State why strict non-preemptive scheduling is unlikely to be used in a computer.
Recent PYQ — must doEnd Term Dec 2024 · Q.2(b)3.5 MarksMid Term Oct 2025 · Q.1(a)2 MarksEnd Term Oct 2025 · Q.3(b)5 MarksVery high
Asked in three recent papers: Dec-2024 Q.2(b), Oct-2025 Q.1(a) and
Oct-2025 Q.3(b). Both Oct-2025 prints say “Refer Q.2(b) from End Term Exam Dec. 2024”, so this is one
master answer.
Show answer
Scheduling falls into one of two categories:
Non-preemptive — once the CPU has been allocated to a process, the process
keeps the CPU until it finishes or voluntarily blocks. Its resources cannot be
taken away before it is done; when the running process finishes and moves to the waiting state,
resources are released and switched.
Preemptive — the OS assigns resources for a predetermined period. The
process switches from running to ready, or from waiting to ready, during resource allocation;
this happens because the CPU may give other processes priority and substitute the currently
active process for a higher-priority one.
Aspect
Preemptive scheduling
Non-preemptive scheduling
Definition
CPU can be taken away from a running process before it finishes
CPU is given to a process and runs until completion or until it blocks
Control
The OS has control over process switching
The process has control over when to release the CPU
Response time
Better for real-time and interactive systems
Slower, especially for short urgent tasks
Starvation risk
Higher (some processes may be preempted too often)
Lower (every process eventually gets full CPU time)
Context-switch overhead
Higher — more switches
Lower — fewer switches
Decision happens when
running→ready (interrupt) or blocked→ready
running→waiting, or running→terminated
Algorithms
Round Robin, SRTF, preemptive priority
FCFS, SJF, non-preemptive priority
Shared data
Needs care — a process can stop mid-update, leaving inconsistent data
Safer inside critical sections
Worked mini-example (printed in the Oct-2025 paper)
Two processes: P1 AT 0, BT 10 ms and P2 AT 2, BT 4 ms.
P1
P2
P1
02614
P1P2
Preemptive (SRTF): P1 starts at 0. At time 2, P2 arrives with a shorter burst, so the
CPU interrupts P1 and runs P2 to completion at 6; P1 then resumes and finishes at 14. That
interruption of P1 is what makes the scheduling preemptive.
P1
P2
01014
P1P2
Non-preemptive (FCFS): P1 starts at 0, P2 arrives at 2 but must wait until P1
finishes at 10, then runs to 14. P1 is never interrupted — that is non-preemptive
scheduling.
Why strict non-preemptive scheduling is unlikely in modern systems
Poor responsiveness — once a process starts it runs to completion regardless
of the priority or urgency of other tasks, so an interactive command can wait behind a long
batch job.
Not suitable for multitasking — in older OSs one whole program kept running
until it blocked; in modern OSs time sharing is best manifested because each running process
takes only a fair quantum of CPU time.
Blocking issues — a CPU-bound process holds the CPU while I/O-bound
processes wait, so I/O devices sit idle and then all queue up at once (the convoy effect).
No interrupt handling — the OS could not react to a timer or a device
in the middle of a process, so deadlines and preemption become impossible.
Unit I · Scheduling Criteria
What are various scheduling criteria for CPU scheduling? / Explain the criteria for choosing a CPU scheduling algorithm.
Recent PYQ — must doEnd Term Dec 2025 · Q.1(a)5 MarksEnd Term Jan 2024 · Q.1(d)2 MarksVery high
Asked in: Dec-2025 Q.1(a) (5) · Jan-2024 Q.1(d) (2, whose printed answer
says “Refer to Q.1(h) of End Term Examination 2018 (Pg. No. 10–2018)”, which is
“Define the criteria of comparison among CPU scheduling algorithms” (2.5) · also
Jul-2016 Q.3(a), May-June 2017 Q.1(f). Same six criteria every time.
Show answer
There are several criteria to check when deciding which scheduling algorithm is “best”. In
general CPU utilisation and throughput are maximised while the other factors are
reduced for proper optimisation.
Criterion
Definition
Wanted direction
1. CPU utilisation
Make the best use of the CPU and waste no cycle; ideally the CPU works 100% of the time. In a real system usage ranges from about 40% (lightly loaded) to 90% (heavily loaded).
Maximise
2. Throughput
Total number of processes completed per unit time (or the amount of work done in a unit time). May range from 10/second to 1/hour depending on the processes.
Maximise
3. Turnaround time
Time taken to execute a particular process — the interval from the time of submission to the time of completion (wall-clock time). TAT = CT − AT.
Minimise
4. Waiting time
Sum of the periods spent waiting in the ready queue to acquire control of the CPU. WT = TAT − BT.
Minimise
5. Load average
Average number of processes residing in the ready queue waiting for their turn to get into the CPU.
Minimise
6. Response time
Time from when a request was submitted until the first response is produced — not the completion of execution.
Minimise
Verification noteThe Jan-2024 paper prints only “(2)” and refers you to
another paper for the content. The six criteria above are the ones printed in the Dec-2025 and
2018 answers, so they are the safe list. Some textbooks list only five (dropping load average) —
if the question is worth 2 marks, write the five without load average.
Illustrate the significance of the terms demand scheduling and real time scheduling.
Recent PYQ — must doEnd Term Jan 2024 · Q.3(b)5 MarksVery high
Show answer
Real-time scheduling
Real-time systems are like super-fast computers that handle tasks needing quick responses.
There are two types of tasks:
Hard real-time tasks — like urgent missions; they must be done exactly on
time or something really bad could happen.
Soft real-time tasks — important too, but it is okay if they are a bit late
sometimes; nothing terrible will happen.
Real-time tasks are the super-important missions that need quick responses: some must be done
right away (hard), others can wait a little (soft). The scheduler's job is to guarantee that
deadlines are met, which is why it is priority-driven and preemptive.
Demand scheduling
Scheduling is the process by which the process manager removes an active process from the CPU
and selects another process based on a specific strategy. Process scheduling is an integral part
of a multiprogramming application set: more than one process is loaded into usable memory at a
time and the loaded processes share the CPU using repetition time (time multiplexing).
There are three types of process schedulers — long term (job),
short term (CPU) and medium term.
Objectives of demand scheduling
Utilisation of CPU at maximum level — keep the CPU as busy as possible.
Allocation of CPU should be fair.
Throughput should be maximum — the number of processes that complete their
execution per time unit should be maximised.
Minimum turnaround time — time taken by a process to finish execution should
be the least.
Minimum waiting time — and the process should not starve in the ready queue.
Minimum response time — the time when a process produces its first response
should be as less as possible.
Exam tipThese six objectives are the same list as the six scheduling
criteria, just phrased as goals. If both questions appear in the same paper, write the criteria
version for one and the objectives version for the other so you do not look like you are
repeating yourself.
Unit I · Scheduling
What is Convoy effect? How [can its avoidance] improve the performance of a system?
Recent PYQ — must doEnd Term Dec 2024 · Q.1(b)5 MarksHigh
Show answer
The Convoy Effect is a phenomenon associated with the First Come First Serve
(FCFS) algorithm in which the whole operating system slows down because of a few slow processes.
FCFS is non-preemptive: once CPU time has been allocated to a process, other processes get CPU
time only after the current process has finished. This property produces the convoy situation.
How it happens, step by step
Suppose one CPU-intensive process (large burst time) is in the ready queue, together with
several processes with relatively less burst time that are I/O-bound.
The I/O-bound processes are allocated CPU time first — they are quickly executed and then go
to their I/O queues.
Now the CPU-intensive process is allocated CPU time. Because its burst time is high it takes
a long time to complete.
While it is running, the I/O-bound processes complete their I/O operations and are moved back
to the ready queue.
However, the I/O-bound processes are made to wait, because the CPU-intensive process still
has not finished. This also leaves the I/O devices idle.
When the CPU-intensive process ends it is sent to the I/O queue so it can access an I/O
device. Meanwhile the I/O-bound processes get CPU time and move back to the I/O queue.
But now they are made to wait again because the CPU-intensive process is still accessing its
I/O device — so the CPU sits idle.
Hence in the convoy effect one slow process slows down the performance of the entire set of
processes and wastes CPU time and other devices.
Fix to write in the answerTo avoid the convoy effect, use preemptive
scheduling algorithms such as Round Robin, because smaller processes do not have
to wait long for CPU time — their execution finishes faster and fewer resources sit idle. SJF /
SRTF also help by putting short jobs first.
Unit I · Scheduling Algorithms
Explain the various CPU scheduling algorithms (FCFS, SJF, SRTF, Round Robin, Priority, Multilevel Queue).
Recent PYQ — must doAsked numerically in every recent paperHigh
Theory asked as: Dec-2024 Q.3(a) (6.5, four algorithms on one table) ·
Oct-2024 Q.4(a) (5) · Dec-2025 Q.2(b) (7, four algorithms). The same five algorithms come back every
year as numericals — see Numericals.
Show answer
Algorithm
Rule
Preemptive?
Best for
Main drawback
FCFS (First Come First Served)
Run processes in arrival order
No
Simple batch systems; easy to implement
Convoy effect; high average waiting time
SJF (Shortest Job First)
Among arrived processes, run the one with the shortest total burst
Usually no
Minimum average waiting time among non-preemptive policies
Needs to know burst in advance; long jobs can starve
SRTF (Shortest Remaining Time First)
Preempt as soon as a newly arrived job has a shorter remaining time
Yes
Optimal average waiting time of all the above
Many context switches; starvation of long jobs
Round Robin
Each process gets at most one quantum, then goes to the tail of the ready queue
Yes
Time-sharing; fairness and good response time
Average waiting time worse than SJF; overhead grows as quantum shrinks
Priority
Run the highest-priority ready process
Either
Real-time and important-system tasks
Low-priority processes starve — fixed by aging
Multilevel Queue
Separate fixed queues (system, interactive, batch) each with its own algorithm
Usually between queues
Classifying processes permanently
Inflexible; a process cannot change queue
Multilevel Feedback Queue
Queues with rules that move a process up or down based on its behaviour
Yes
General-purpose OS; approximates SJF without knowing bursts
Complex to tune parameters
Round Robin — the two things that decide everything
If the quantum is very large (larger than every burst), RR degenerates into FCFS.
If the quantum is very small, context-switch overhead dominates and throughput collapses.
Rule of thumb: keep the quantum much larger than the context-switch time; typical values are
10–100 ms.
Aging
The remedy for starvation in priority scheduling: gradually increase the priority of a process
that has waited a long time, so it eventually reaches the head of the queue.
Verification noteThe May–June 2017 paper asks “what advantage is there
in having different time-quantum sizes at different levels of a multilevel queuing system”.
Answer: processes that need more servicing time should sit in a lower-priority queue with a larger
quantum, so the scheduling overhead per unit of useful work is smaller, while interactive
processes in the top queue keep a short quantum and therefore a fast response.
Unit I Preparation Checklist
Track
Ticks are saved in this browser and survive a refresh. Progress also feeds the dashboard.