GateAI

GATE CSE Processes, Threads and IPC PYQs

Standard yield8.3% of Operating Systems

GATE evaluates the 'Processes' topic primarily through the standard 5-state process lifecycle (New, Ready, Running, Blocked/Waiting, Terminated) and the valid/i… Read the guide

Questions
15
Asked
since 2011
Total marks
16
Marks / paper
0.6

15 GATE CSE Processes, Threads and IPC PYQs with solutions, from Operating Systems. Browse all GATE CSE PYQs.

Questions

Every official paper that asked this topic, newest first.

What GATE tests in Processes, Threads and IPC

Concepts, patterns, formulas and traps distilled from past papers.

GATE evaluates the 'Processes' topic primarily through the standard 5-state process lifecycle (New, Ready, Running, Blocked/Waiting, Terminated) and the valid/invalid transitions between these states. Questions consistently test the exact path of a process during execution, preemption, and I/O invocation. Recent trends show a progression from purely theoretical transition checks (MCQ/MSQ) to procedural tracing of state changes in C code execution (NAT).

Core concepts

  • 5-state process lifecycle model (New, Ready, Running, Blocked/Waiting, Terminated)
  • Valid direct state transitions versus illegal shortcuts (e.g., Blocked to Ready is valid, but Blocked to Running is illegal)
  • Preemption mechanisms causing Running to Ready transitions (timer interrupts, quantum expiration)
  • I/O blocking behavior: Running to Blocked on I/O request, and Blocked to Ready upon I/O completion
  • Distinction between CPU-bound bursts and I/O-bound context switches in C code
  • Thread-private state (Program Counter, Stack Pointer, General Purpose Registers, Thread Control Block)
  • Process-shared resources (Address space, Page Table Base Register, open file descriptors, Heap, Data/Code segments)
  • Intra-process vs. Inter-process context switching overhead
  • Process lifecycle states (Ready, Running, Blocked/Waiting)
  • Relationship between CPU count and maximum processes in the Running state
  • Ready queue capacity independence from CPU count
  • Thread execution context: Program Counter, Register Set, Stack (Thread-private)
  • Shared process resources: Address space (code, global data, heap), Open files, Signal handlers
  • User-level threads (ULT) vs. Kernel-level threads (KLT)
  • Per-thread private resources (Stack, Registers/Program Counter, Thread Control Block)
  • Process-shared resources (Heap, Data/Code segment, File Descriptor Table, Address Space)
  • Memory protection and isolation within vs. across processes
  • Process creation via `fork()` system call
  • Parent vs child process relationship and hierarchy
  • Binary process tree generation
  • Process State Transitions (Running to Blocked vs Running to Ready)
  • Blocking vs Non-blocking System Calls
  • Page Fault Handling and Demand Paging I/O latency
  • Hardware Interrupts and Interrupt Service Routines (ISR)
  • Timer Interrupts and Time-slice Preemption Criteria
  • Context Switching Mechanisms
  • Per-thread vs per-process resources (stack/registers/TCB vs heap/data/code/page tables)
  • User-level threads (ULT) vs Kernel-level threads (KLT) trade-offs and blocking semantics
  • fork() return value semantics (0 in child, PID > 0 in parent)
  • Process lifecycle and execution tree generation in loops with break/continue
  • Non-atomic Read-Modify-Write instructions and shared memory race conditions
  • Worst-case and best-case preemption scheduling for concurrent shared variable manipulation

Recurring question patterns

  • Process State Transition Validity

    Commonmixed1 marks2024, 2020

    Questions present either a list of statements or transition pairs (e.g., Blocked to Running, Ready to Waiting) and ask to identify which transitions are valid, invalid, or possible under preemptive/non-preemptive models.

  • Code-Based Process Lifecycle Tracing

    OccasionalNAT1 marks2025

    A C program containing system calls or standard I/O functions (such as scanf and printf) is provided, requiring the candidate to trace loop iterations and count how many times a process transitions between Running, Blocked, and Ready queues.

  • Thread Context Switch State Identification

    RareMSQ1 marks2023

    Identifying which hardware registers, memory structures, and control blocks are saved/restored during an intra-process thread switch versus an inter-process context switch.

  • Process State Capacity vs Hardware Bounds

    OccasionalMCQ1 marks2015

    Questions evaluating the theoretical maximum or limit on the number of processes in a specific state (e.g., Ready vs Running) relative to system parameters like CPU count (nn).

  • Thread Resource Sharing Identification

    OccasionalMCQ1 marks2017

    Questions listing execution context elements (registers, stack, program counter, address space, file descriptors) and asking which are shared vs private among threads of the same process.

  • Thread Resource Sharing and Implementation Properties

    RareMSQ1 marks2024

    Multi-statement conceptual evaluation assessing what resources (stack, heap, file descriptors, address space) are shared vs. private among threads, and implementation models (user space vs. kernel space).

  • Sequential Fork Process Counting

    RareMCQ1 marks2012

    Determining the number of processes (or child processes) spawned by executing a sequence of unconditional fork() system calls.

  • Process State Transition and Mandatory Context Switch Analysis

    OccasionalMSQ1 marks2024

    Evaluating which hardware or software events (blocking system calls, page faults, timer ticks, unrelated device interrupts) strictly force a running process to yield the CPU and transition to a non-running state (Blocked/Ready) versus events that merely execute an ISR and resume the running process.

  • Thread Resource Sharing and Thread Management Models

    CommonMCQ1 marks2017, 2014, 2011

    Evaluating conceptual assertions about what is thread-private (program counter, registers, stack) versus process-shared (address space, heap, global variables, open files), as well as differences between user-level and kernel-level threads (context switch overhead, blocking calls, scheduling).

  • Process Creation & fork() Execution Tracing

    CommonNAT1.5 marks2026, 2019

    Code snippets with loops executing fork() under conditional checks (e.g., modulo conditions or return-value checks like fork() == 0 with break/continue), requiring calculation of total child processes created or the count of specific print statements.

  • Race Conditions and Interleaving on Shared Variables

    OccasionalNAT1 marks2019

    Analyzing concurrent processes performing arithmetic updates on a shared variable under uniprocessor time-sharing to determine the extreme possible values (minimum, maximum, or their range) caused by arbitrary preemption between atomic load, calculate, and store instructions.

Formulas GATE uses

Total Ready Queue Entries (from I/O)

Ready Entries=Ninitial+NI/O completed+Npreemptions\text{Ready Entries} = N_{\text{initial}} + N_{\text{I/O completed}} + N_{\text{preemptions}}

Used when calculating how many times a process enters the ready queue during its lifecycle, paying close attention to whether the initial process admission (NinitialN_{\text{initial}}) is explicitly included or excluded in the stem.

Maximum Running Processes Bound

Max(Running Processes)=n\text{Max}(\text{Running Processes}) = n

Used when determining the upper limit of processes actively executing in a system with nn CPUs.

Total Processes Created by Consecutive Forks

Ntotal=2nN_{\text{total}} = 2^n

Used to find the total number of processes (including the initial parent process) after nn unconditional sequential fork() calls.

Total Child Processes Created

Nchild=2n−1N_{\text{child}} = 2^n - 1

Used when the question specifically asks for the number of *child* processes created by an initial parent executing nn consecutive fork() calls.

Total Processes from Sequential Forks

Ptotal=2nP_{\text{total}} = 2^n

When nn unconditional sequential fork() system calls are executed in a program without branching.

Child Processes Created from Sequential Forks

Pchild=2n−1P_{\text{child}} = 2^n - 1

Used to find the count of newly spawned child processes excluding the initial parent process after nn sequential unconditional forks.

Examiner traps in Processes, Threads and IPC

  • Believing a blocked process can directly regain CPU and become Running upon I/O completion without re-entering the Ready queue.
  • Assuming a process in Ready state can directly transition to Blocked/Waiting state without being dispatched to Running first.
  • Off-by-one counting in NAT code-tracing by forgetting to exclude initial process placement in the ready queue when specifically instructed, or miscounting loop bounds (e.g., i < 20 vs i ≤ 20).
  • Missing I/O operations located outside loop constructs (e.g., an initial `scanf` preceding a `for` loop of `printf`s).
  • Confusing thread context switching with full process context switching by incorrectly including address translation registers (e.g., Page Table Base Register / PTBR) among saved items for intra-process thread switches.
  • Assuming threads share stack space because they share the general virtual address space (each thread requires its own private stack and Stack Pointer).
  • Confusing the maximum number of processes in the *Running* state (bounded by n CPUs) with the *Ready* state (bounded by memory/OS capacity, independent of n).
  • Assuming the stack or registers are shared across threads; each thread must maintain its own private stack and register state for independent execution flow.
  • Assuming global heap or address space is private per thread instead of shared.
  • Assuming threads share a single common execution stack (each thread must have its own private stack).
  • Believing each thread maintains its own independent open file descriptor table (file descriptors belong to the enclosing process).
  • Assuming memory protection boundaries exist by default between threads of the same process (they share a single address space without OS-level inter-thread protection).
  • Believing threads are strictly confined to kernel-space implementation (overlooking user-level thread libraries).
  • Confusing total processes (2n) with child processes created (2n - 1), causing candidates to select 8 instead of 7.
  • Assuming `fork()` creates a linear number of processes (n) rather than doubling at each step (2n).
  • Confusing the execution of an Interrupt Service Routine (ISR) with a process context switch; handling an interrupt in kernel mode does not inherently move the interrupted process out of the running state.
  • Assuming every timer interrupt causes a preemption; a timer tick updates kernel accounting and only triggers preemption if the process quantum has fully expired or a higher-priority task is awakened.
  • Failing to recognize a page fault as a synchronous blocking event that must suspend the running process until secondary memory I/O completes.
  • Confusing total processes (2n) with total child processes (2n - 1).
  • Assuming heap or global variables are duplicated per thread rather than shared across all threads within the process.
  • Thinking thread context switching requires no register saving; each thread has its own register state and stack pointer.
  • Treating high-level statements like 'D = D + 20' as atomic rather than 3 separate assembly-level instructions (READ, ADD, WRITE).
  • Failing to track how break/continue inside 'if (fork() == 0)' differentiates parent vs. child loop iteration counts.

How questions are asked

  • Identify valid/invalid process transitions
  • Multi-statement verification under preemptive scheduling
  • Count process queue entries from a C program snippet
  • Identify saved CPU registers during thread/process context switch (MSQ/MCQ)
  • Classify resources as shared across threads or private to a thread
  • Direct conceptual multiple-choice question on system resource scaling
  • Roman numeral multi-statement identification of shared/private thread resources
  • Conceptual multi-statement verification (MSQ)
  • Count child or total processes in a short C/pseudocode snippet
  • Conceptual multi-statement evaluation (MSQ) on OS events causing process state changes
  • Conceptual TRUE/FALSE statement identification regarding thread states
  • Trace C snippet containing fork() inside loops to count processes or prints
  • Calculate minimum/maximum possible value of a shared variable under concurrent execution

Paper trends

  • Transitioned from traditional 1-mark single-choice conceptual questions to MSQs testing multiple invalid transitions simultaneously, and finally to NAT code-tracing problems mapping C I/O calls directly to process state changes.

    2025, 2024, 2020

  • Recent exams leverage the MSQ format to test multiple components of thread-private state (e.g., Stack Pointer, Program Counter, General Purpose Registers) simultaneously, penalizing superficial knowledge.

    2023

  • Questions are conceptual 1-mark items testing core definition-level distinctions (Ready queue independence from CPU count, and thread-private vs thread-shared memory resources).

    2017, 2015

  • Recent papers leverage the MSQ format to test multiple precise conceptual boundaries regarding thread memory organization, protection models, and implementation spaces in a single question.

    2024

  • Focuses on fundamental understanding of exponential process tree doubling via successive fork() invocations.

    2012

  • Recent papers introduced fine-grained MSQ conceptual questions checking precise OS kernel mechanisms, such as distinguishing between an interrupt service routine (ISR) execution and an actual process context switch.

    2024

  • Earlier papers (2011-2017) focused predominantly on 1-mark theoretical MCQs assessing thread memory isolation and kernel vs. user thread behavior.

    2017, 2014, 2011

  • Recent examinations heavily emphasize NAT questions involving precise code tracing of fork() control logic and deep execution order interleaving for shared memory concurrency.

    2026, 2019

Difficulty notes

All recent PYQs on this specific topic are 1-mark Easy questions. Easy questions directly test whether a student remembers the 5-state diagram arrows. Moderate/Hard variations introduce loop tracing with conditional I/O statements, parent-child fork hierarchies, or mixed timer preemption with I/O blocking.