As we know that when a thread acquires a semaphore, then the value of semaphore gets decremented by 1 and when a thread releases a semaphore, then the value of semaphore gets incremented by 1.
Now, let’s assume that the value of semaphore is initialized to 12 and in the course of execution of the process, semaphore is acquired 10 times and released 4 times. What is the minimum value possible for the semaphore?
Options
This problem has only one correct answer
(a) Minimum = 6
(b) Minimum = 4
(c) Minimum = 2
(d) Minimum = 8
Answers
Answered by
2
Answer:
d) Minimum =8 is correct answer.
Explanation:
pls mark me as brainlist
Answered by
1
Answer: 2
Explanation: The minimum value can be found by acquiring all the semaphores at once and thereby decrementing the semaphore value to maximum. Hence, the minimum value is 2.
Similar questions