GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 1.32

Deadlock-free tape-drive bound

Operating Systems · Deadlocks · Full GATE CSE 1998 paper

GATE 1998, Q1.32 1 mark · MCQ
Report issue

Deadlocks

Question 1.32, GATE 1998: Six identical tape drives are shared by n processes, each needing at most two. Find the largest n guaranteeing no resource deadlock among 6, 5, 4, 3.
Tap to enlarge
Your answer
Answer & solution

Answer: B: 5 under unrestricted incremental allocation (no official key was published)

The dangerous state gives each process one drive while it waits for a second. With n≤5, at least one of six drives remains free, so some waiting process can receive its second, finish and release both; repeat to complete others. With n=6, all six can hold one and wait forever for a second, producing deadlock. Therefore the largest guaranteed-safe n is 5, B. This is a worst-case allocation guarantee, assuming eventual release and no other resources; an avoidance policy could safely serialize more processes.

Original paper, page 3