A counting semaphore is initialized to 8. 3 wait() operations and 4 signal() operations are applied. Find the current value of semaphore variable.

This question was previously asked in
UGC NET Computer Science (Paper 2) Dec 2019 Paper
View all UGC NET Papers >
  1. 9
  2. 5
  3. 1
  4. 4

Answer (Detailed Solution Below)

Option 1 : 9
Free
UGC NET Paper 1: Held on 21st August 2024 Shift 1
13 K Users
50 Questions 100 Marks 60 Mins

Detailed Solution

Download Solution PDF

Concepts:

V(S): Signal operation will increment the semaphore variable, that is, S++.

P(S): Wait operation will decrement the semaphore variable., that is, S--.

Data:

Initial counting semaphore = I = 8

Wait operation = 3 P

Signal operation = 4 V

Final(current) counting semaphore = F

Formula:

F = I + 4V + 3P

Calculation:

F = 8 + 4(+1) + 3(-1)

∴ F = 9

the resulting value of the semaphore is 9
Latest UGC NET Updates

Last updated on Jun 12, 2025

-> The UGC NET June 2025 exam will be conducted from 25th to 29th June 2025.

-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.

-> The exam is conducted bi-annually - in June and December cycles.

-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions. 

-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.

More Operating System Solution Questions

More Concurrency and Synchronization Questions

Get Free Access Now
Hot Links: teen patti club teen patti gold online real teen patti