A multithreaded program \(P\) executes with \(x\) number of threads and uses…

GATE · 2017 · CS · Set 1 · Computer Science & IT

A multithreaded program PP executes with xx number of threads and uses yy 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 ll, then it cannot re-acquire lock ll without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of xx and the minimum value of yy together for which execution of PP can result in a deadlock are:

  1. A.

    x=1,y=2x = 1, y = 2

  2. B.

    x=2,y=1x = 2, y = 1

  3. C.

    x=2,y=2x = 2, y = 2

  4. D.

    x=1,y=1x = 1, y = 1

Attempted by 144 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…