Computer AwarenessHardIBPS SO IT Officer
A counting semaphore starts at 7. Then 20 wait (P) operations and 15 signal (V) operations are performed on it. What is its final value?
- A. 2
- B. 12
- C. −8
- D. 5
Correct answer: A. 2
Each P subtracts 1 and each V adds 1: 7 − 20 + 15 = 2. A negative value would mean processes are blocked on it.
हिंदी में
एक काउंटिंग सेमाफ़ोर 7 से शुरू होता है। फिर उस पर 20 वेट (P) संक्रियाएँ और 15 सिग्नल (V) संक्रियाएँ की जाती हैं। उसका अंतिम मान क्या है?
- A. 2
- B. 12
- C. −8
- D. 5
उत्तर: A. प्रत्येक P में से 1 घटता है और प्रत्येक V में 1 जुड़ता है: 7 − 20 + 15 = 2। ऋणात्मक मान का अर्थ होता कि प्रक्रियाएँ उस पर ब्लॉक्ड हैं।
More Computer Awareness questions
- Which of these is NOT one of the three requirements a correct critical-section solution must meet?
- How does a microkernel operating system differ from a monolithic one?
- In the many-to-one threading model (many user-level threads mapped to one kernel thread), what happens when one thread makes a blocking…
- The main purpose of multiprogramming in an operating system is to:
- Which file-allocation method allows fast direct access to any block but suffers from external fragmentation?
- Which Windows file system supports file-level permissions, journaling for crash recovery and single files larger than 4 GB?