GATE CSE 2017 Session 1 Q37: Minimum threads and non-reentrant locks for a possible deadlock
- Operating System
- 2 marks
- MCQ
- −2/3 if wrong
Syllabus topic: Deadlock
Question
A multithreaded program P executes with number of threads and uses number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock , then it cannot re-acquire lock without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of and the minimum value of together for which execution of P can result in a deadlock are:
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: D (official GATE 2017 final answer key)
Concept used: With non-reentrant locks, a thread that tries to acquire a lock it already holds blocks on itself forever.
First step: Ask whether a single thread with a single lock can block forever, given the non-reentrant rule.
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Deadlock
Every PYQ on this topic →Share this question
Source: official GATE 2017 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Operating System PYQs
- 2026 Session 1 · Q29False statements about deadlocks
- 2026 Session 1 · Q35Minimum resource instances for deadlock freedom (5 processes, max 2)
- 2026 Session 1 · Q59Disk transfer time for random sectors on tracks 5, 12, 7
- 2026 Session 1 · Q63Number of printf calls with fork, continue and break
- 2026 Session 1 · Q64Average FCFS waiting time for alternating A and C processes
- 2026 Session 2 · Q23CPU scheduling algorithm that cannot be preemptive