All mock tests are FREE till 31 December — register to save your progress
Unit 2 · Operating System & System Software HTET 2022 PGT Computer Science

In context of semaphores choose the option with valid codes for wait() and signal() functions :

सेमाफोर के संदर्भ में Wait() तथा Signal() फलनों के लिए उचित कोड वाले विकल्प का चुनाव कीजिए :

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. Wait (s) { while (s) < = 0; s – – } and signal (s) { s + +; }

Explanation

wait(S): while (S <= 0); S--; signal(S): S++; — wait blocks while the semaphore is not positive, then decrements it; signal increments it.

wait(S): while (S <= 0); S--; signal(S): S++; — wait सेमाफोर धनात्मक होने तक रुकता है फिर घटाता है, signal बढ़ाता है।

More Operating System & System Software questions