GATE 2014 SET-2 | OS | SEMAPHORE | PRODUCER | GATE TEST SERIES | SOLUTIONS ADDA | EXPLAINED BY VIVEK

GATE 2014 SET-2 | OS | SEMAPHORE | PRODUCER | GATE TEST SERIES | SOLUTIONS ADDA | EXPLAINED BY VIVEK

GATE 2014 SET-2 Q41: Consider the procedure below for the Producer-Consumer problem which uses semaphores: semaphore n=0; semaphore s=1; void producer() void consumer() { { while(true) while(true) { { produce(); semWait(s); semWait(s); semWait(n); addToBuffer(); removeFromBuffer(); semSignal(s); semSignal(); semSignal(n); consume(); } } } } Which one of the following is TRUE? Website: https://solutionsadda.in/ ISRO / DRDO PYQs: https://solutionsadda.in/isro/ GATE PYQs : https://solutionsadda.in/gate1/ NIC - NIELIT PYQs: https://solutionsadda.in/nielit/ ISRO Complete Analysis: https://solutionsadda.in/isro-complet... NIC-NIELIT Complete Analysis: https://solutionsadda.in/nielit/ GATE Complete Analysis: https://solutionsadda.in/gate-complet... For GATE, BARC, ISRO, CIL, AAI, HAL, UGC NET JRF, NIC NIELIT, STQC NIELIT, NVS, KVS, DSSSB PGT/TGT Test series : https://solutionsadda.in/test-series/ If you have any queries write a mail: [email protected] Face Book Page:   / solutionsaddain-111628724482494   Telegram: https://t.me/solutionsaddaforcse