Gate CS-2014-2 Question Paper With Solutions

Q. 41 Consider the procedure below for the Producer-Consumer problem which uses
semaphores:

semaphore n = 0;
semaphore s = 1;

Gate CS-2014-2 Question Paper With Solutions
Which one of the following is TRUE?

(A) The producer will be ablve to add an item to the buffer, but the consumer
can never consume it.

(B) the consumer will remove no more than one item from the buffer.

(C) Deadlock occurs if the consumer succeeds in acquiring semaphore s when the
buffer is empty.

(D) The starting value for the semaphore n must be 1 and not 0 for deadlock-free
operation

Answer: (C)

Explanation:

Gate CS-2014-2 Question Paper With Solutions

Learn More:   Gate ME-2009 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here