Q.1
14 MarksProgram vs Process vs Thread
- Program:
- A passive entity consisting of a collection of instructions stored on disk as an executable file (e.g.,
app.exe). Does not consume CPU or RAM.
- Process:
- An active entity representing a program in execution. Has its own dedicated address space, Program Counter, stack, data, and PCB.
- Thread:
- The smallest unit of CPU execution within a process, often called a lightweight process.
- Shares the code, data section, and OS resources with peer threads of the same process, but maintains its own private Program Counter, register set, and stack.
What is Process State? Explain different states of a process with various queues generated at each stage.
Also asked in Summer 2026 Q3b
Process States and Operating System Queues
A process transitions through five primary states during its lifetime:
[ New ] ----(admitted)----> [ Ready ] <---(interrupt)----+
| |
(scheduler) [ Running ]
v |
[ Running ] ----(I/O wait)--->+
| v
(terminated) [ Waiting / ]
v [ Blocked ]
[ Terminated ] |
^ (I/O completion)
| v
+------------------- [ Ready ]Corresponding OS Scheduling Queues:
- Job Queue: Holds all processes admitted to the system residing on secondary storage.
- Ready Queue: Resides in main memory holding all processes that are ready and waiting to be allocated CPU time by the Short-Term Scheduler.
- Device / I/O Queue (Wait Queue): List of processes waiting for a specific I/O device (e.g., disk controller, network card).
1. Core Functions of an Operating System
- Processor Management: Allocates CPU time to processes via scheduling algorithms.
- Memory Management: Dynamically tracks and allocates/deallocates primary memory partitions.
- File System Management: Organizes files into directories and controls access permissions.
- Device Management: Manages I/O devices through unified device drivers and buffers.
- Security & Protection: Protects system resources against unauthorized access.
2. Detailed Explanation of Types of Operating Systems
A. Batch Operating System:
- Users submit jobs on punch cards/tapes to an operator without direct interactive computer access.
- The operator sorts jobs with similar requirements into batches and runs them as a group.
- Pros: Maximizes CPU utilization for heavy sequential workloads.
- Cons: Zero user interaction; long turnaround times; high starvation risk for small jobs.
B. Time-Sharing (Multitasking) Operating System:
- Extends multiprogramming using CPU scheduling (Round Robin) and rapid time-slicing (quantum ).
- The CPU switches between active users so rapidly that each user perceives dedicated access to the machine.
- Pros: Immediate user response time; prevents single-process CPU monopolization.
- Examples: Unix, Linux, Windows NT.
C. Real-Time Operating System (RTOS):
- Designed for systems where computational correctness depends strictly on the logical result and the time deadline within which results are produced.
- Hard RTOS: Missing a deadline results in catastrophic failure (e.g., Aircraft flight control, Missile guidance, Pacemakers). No virtual memory used.
- Soft RTOS: Missing a deadline degrades service quality but does not cause total failure (e.g., Video streaming, cellular telephony).