Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
715 views
in Computer by (113k points)
closed by
At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and 15 V operation were completed on this semaphore. The resulting value of the semaphore is
1. 42
2. 2
3. 7
4. 12

1 Answer

0 votes
by (115k points)
selected by
 
Best answer
Correct Answer - Option 2 : 2

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 = 7

Wait operation = 20 P

Signal operation = 15 V

Final counting semaphore = F

Formula:

F = I + 15V + 20P

Calculation:

F = 7 + 15(+1) + 20(-1)

∴ F = 2

the resulting value of the semaphore is 2

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...