GATEverse Practice, past papers & mock tests
GATE 2018
Operating SystemsProcess Management-IImediumMCQ2 marks
Consider the following solution to the producer-consumer problem with buffer size N. Semaphores empty, full and mutex are initialized to 0, N and 1, respectively. Semaphore empty denotes available filled slots for consumer to read; full denotes available empty slots for producer to write. Producer: wait(P); wait(mutex); add_item(); signal(mutex); signal(Q); Consumer: wait(R); wait(mutex); remove_item(); signal(mutex); signal(S); Which assignment to (P, Q, R, S) yields the correct solution?
Save your progress

Related Operating Systems PYQs