The Semaphore variable full, empty and mutex are initialized to 0, n and 1 respectively. Process P1 repeatedly adds one item at a time to a buffer of size n, and process P2 repeatedly removes one item at a time from the same buffer using the programs given below. In the programs, K, L, M & N are unspecified statements.
P1: while(1)
{ K;
P(Mutex);
Add item to buffer;
V(mutex);
L; }
P2:
while(1) { M;
P(mutex);
Remove item from the buffer;
V(mutex);
N; }
These statements K, L, M & N are respectively:
(a) P(full), V(empty), P(full), V(empty)
(b) P(full), V(empty), P(empty), V(full)
(c) P(empty), V(full), P(empty), V(full)
(d) P(empty), V(full), P(full), V(empty)