Consider the notation nP and mQ to indicate n down operations and m up operations on a semaphore respectively. For an application using a counting
semaphore, the following sequence of operations is obtained: 5P, 2V, 10P, 5V, 4P. The value of the semaphore at the end of these operations is -7.
What is the initial value of the semaphore?
Answers
Answered by
0
Answer:
I cannot understand the question
Answered by
1
Answer:
5
Explanation:
X = Initial semaphore count
Final count = -7
P = Decrement, V = Increment
Therefore,
X - 5 + 2 - 10 + 5 - 4 = -7
X - 19 + 7 = -7
X = 19 - 7 - 7 = 19 - 14
X = 5
Similar questions
Science,
6 months ago
English,
6 months ago
Physics,
11 months ago
Geography,
11 months ago
Computer Science,
1 year ago