Threads and the fork system call generate two of the most reliable question types in Operating Systems. One tests concepts: what a user-level thread can do that a kernel thread cannot, and which resources threads of a process share. The other is pure counting: how many processes a chain of fork calls produces. GATE mixes both, while UGC NET, DSSSB and placement screens reuse the threading-model definitions almost verbatim.
Below are 12 solved MCQs from KnowledgeGate's published question bank, most of them real previous-year questions with the exam and year noted. Attempt each before reading the answer; the explanation stays short on purpose. The full theory sits in the threads and process creation learn module.
A note on the deep links: where a question is a GATE PYQ carried inside the GATE course, we link its exact solved page. The questions from other recruitment papers live in the same module's practice sets, so for those the module link above is your entry point.
Threads and threading models
Q1. Consider these statements on user-level and kernel-supported threads: i. context switch is faster with kernel-supported threads, ii. for user-level threads a system call can block the entire process, iii. kernel-supported threads can be scheduled independently, iv. user-level threads are transparent to the kernel. Which are true? *(GATE 2004, see the solved page)*
(a) (II), (III) and (IV) only
(b) (II) and (III) only
(c) (I) and (III) only
(d) (I) and (II) only
Answer: (a) (II), (III) and (IV) only.
Statement i is false: user-level switches are faster because they avoid the kernel entirely. The other three hold, since a blocking system call stalls a whole user-threaded process, kernel threads can be scheduled independently, and user threads are invisible to the kernel by definition. So II, III and IV are the true set.
Q2. Consider statements about user-level and kernel-level threads. Which one is FALSE? *(GATE 2007, see the solved page)*
(a) Context switch time is longer for kernel level threads than for user level threads.
(b) User level threads do not need any hardware support.
(c) Related kernel level threads can be scheduled on different processors in a multi-processor system.
(d) Blocking one kernel level thread blocks all related threads.
Answer: (d) Blocking one kernel level thread blocks all related threads.
That "all get blocked" behaviour is the weakness of user-level threads, not kernel-level ones. Because the kernel schedules each kernel thread on its own, one blocking for I/O leaves its siblings free to run. The other three statements are accurate, which makes (d) the false claim.
Q3. Which one of the following is NOT shared by the threads of the same process? *(GATE 2004, see the solved page)*
(a) Stack
(b) Address Space
(c) File Descriptor Table
(d) Message Queue
Answer: (a) Stack.
Threads share the address space, open file descriptors and message queues of their process, which is exactly what makes them lightweight. But each thread needs its own stack and register set to hold its local variables and return addresses without stepping on the others. So the stack is the one thing that stays private.
Q4. Identify the category of multithreading which allows a program to continue running even if part of it is blocked or is performing a lengthy operation. (BEL 2023)
(a) Economy
(b) Scalability
(c) Responsiveness
(d) Resource sharing
Answer: (c) Responsiveness.
Responsiveness is the benefit that a multithreaded program keeps reacting to the user even while one thread waits on a slow operation. Economy and resource sharing describe cost and memory advantages, and scalability is about using more cores. Only responsiveness names the "keep going while one part blocks" property.
Q5. Which of the following statements about a thread is false? (CDAC CCAT 2019)
(a) Thread is a lightweight process
(b) Every process has at least 1 thread
(c) Each thread has its own Program Counter
(d) All threads in a process share stack
Answer: (d) All threads in a process share stack.
Threads do share code and data and are rightly called lightweight processes, every process has at least one thread, and each thread carries its own program counter. What they do not share is the stack, since each thread must track its own call chain. That makes the shared-stack claim the false one.
Q6. Which of the following best describes a multithreaded process? (TPSC 2025)
(a) A process that contains multiple independent programs
(b) A process that runs on multiple CPUs simultaneously
(c) A process that consists of multiple threads of execution
(d) A process that handles multiple I/O devices
Answer: (c) A process that consists of multiple threads of execution.
A multithreaded process is one program split into several concurrent paths of execution that share its memory. It is not multiple programs, and it does not require multiple CPUs, since threads can interleave on a single core. The defining feature is simply more than one thread inside one process.
Q7. In ________, one thread immediately terminates the target thread. (DSSSB 2018)
(a) Asynchronous cancellation
(b) Synchronous cancellation
(c) Deferred cancellation
(d) Both deferred and asynchronous cancellation
Answer: (a) Asynchronous cancellation.
Asynchronous cancellation kills the target thread at once, without waiting for it to reach a safe point. Deferred cancellation is the safer alternative, where the target checks a flag at cancellation points and stops itself. Since the question stresses immediate termination, asynchronous is the match.
Q8. Assertion A: a process invokes a library function to create a thread. Reason R: the threads make system calls to convey their resource and I/O requirement to the kernel. (UGC NET 2023)
(a) Both A and R are true and R is the correct explanation of A
(b) Both A and R are true but R is not the correct explanation of A
(c) A is true but R is false
(d) A is false but R is true
Answer: (b) Both A and R are true but R is not the correct explanation of A.
Thread creation does go through a library call, so A is true, and threads do make system calls for kernel resources, so R is true. But R talks about how a running thread requests resources, not about how a thread is created. Since R does not explain A, the answer is (b).
Process creation and the fork system call
Q9. A process executes for (i = 0; i < n; i++) fork(); The total number of child processes created is *(GATE 2008, see the solved page)*
(a) n
(b) 2^n - 1
(c) 2^n
(d) 2^(n+1) - 1
Answer: (b) 2^n - 1.
Each fork call makes every existing process spawn one child, so the process population doubles on every iteration. After n iterations there are 2^n processes in total. Subtracting the one original parent leaves 2^n minus 1 children.
Q10. For the code if (fork() == 0) { a = a + 5; print a, &a; } else { a = a - 5; print a, &a; }, let u, v be values printed by the parent and x, y by the child. Which is TRUE? *(GATE 2005, see the solved page)*
(a) u = x + 10 and v = y
(b) u = x + 10 and v != y
(c) u + 10 = x and v = y
(d) u + 10 = x and v != y
Answer: (c) u + 10 = x and v = y.
The child takes the if branch and adds 5, while the parent takes the else branch and subtracts 5, so from a common start the child's value is 10 above the parent's, giving u + 10 = x. The address printed is a virtual address, and fork gives the child an identical copy of the parent's address space, so &a is the same in both. Hence v equals y.
Q11. A process executes fork(); fork(); fork(); The total number of child processes created is *(GATE 2012, see the solved page)*
(a) 3
(b) 4
(c) 7
(d) 8
Answer: (c) 7.
Every fork doubles the number of processes, so three forks turn one process into 2 to the power 3, which is 8. Of those, one is the original parent, so the children number 8 minus 1, which is 7. The trap is answering 8, which counts the parent as a child.
Q12. A multithreaded program uses x threads and y non-reentrant locks for mutual exclusion. A thread that cannot acquire a lock blocks until it becomes available. The minimum values of x and y together for which execution can result in a deadlock are: *(GATE 2017, see the solved page)*
(a) x = 1, y = 2
(b) x = 2, y = 1
(c) x = 2, y = 2
(d) x = 1, y = 1
Answer: (d) x = 1, y = 1.
Because the locks are non-reentrant, a thread that already holds a lock and tries to acquire the same lock again blocks waiting for itself. That single thread and single lock are enough to produce a self-deadlock. So the minimums are x equal to 1 and y equal to 1.
Where these 12 fit in your preparation
The set mirrors how the topic is examined: the threading-model concepts of what threads share and how user and kernel threads differ (Q1 to Q8), then the process-creation core built on fork counting and copy-on-write reasoning (Q9 to Q12). If the fork numericals trip you, fix the two-line rule in memory, each fork doubles the processes, and children equal total minus the one original.
For the theory behind every answer, work through the threads and process creation learn module and place the topic in context with our Operating Systems for GATE breakdown. GATE aspirants get the full OS sequence inside GATE Guidance by Sanchit Sir; for teaching and PSU papers, browse the GATE CS category page. Solve, review what you missed, and come back to the fork questions a week later.




