Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 1 : 0

Advertisement

Detailed Solution

सही उत्तर 0 है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

A counting semaphore S is initialized to 3. After 5 wait (P) operations and 2 signal (V) operations on S, the value of S is ___ / एक काउंटिंग सेमाफोर S को 3 से प्रारंभ किया गया है। S पर 5 wait (P) ऑपरेशन और 2 signal (V) ऑपरेशन के बाद S का मान ___ है

1.
0
2.
-2
3.
1
4.
2

Correct Answer: 0

Each wait decrements and each signal increments: 3 - 5 + 2 = 0. Option (b) is the trap of stopping the arithmetic at 3 - 5 = -2. / प्रत्येक wait घटाता है और प्रत्येक signal बढ़ाता है: 3 - 5 + 2 = 0। विकल्प (b) 3 - 5 = -2 पर अंकगणित रोकने का जाल है।

Downloaded from PrepSnap (prepsnap.in)