Question 7812 – Algorithms
November 10, 2023
Hadoop
November 10, 2023
Question 7812 – Algorithms
November 10, 2023
Hadoop
November 10, 2023

NTA UGC NET JUNE-2023 Paper-2

Question 6
At particular time of computation, the value of a counting semaphore is 7.Then 20p operations and ‘x’ V operations were completed on this semaphore.if the final value of semaphore is 5,x will be
A
15

B
22
C
18
D
13
Question 6 Explanation: 
The final value of a counting semaphore after ‘p’ P (wait) operations and ‘v’ V (signal) operations can be calculated as follows:

Final Value = Initial Value + V – P

In this case, the initial value is 7, ‘p’ is 20, and ‘v’ is x. So,

Final Value = 7 + x – 20

Given that the final value is 5, we can set up the equation:

5 = 7 + x – 20

Now, solve for ‘x’:

x = 5 – 7 + 20
x = 18

So, the value of ‘x’ is 18.

Correct Answer: C
Question 6 Explanation: 
The final value of a counting semaphore after ‘p’ P (wait) operations and ‘v’ V (signal) operations can be calculated as follows:

Final Value = Initial Value + V – P

In this case, the initial value is 7, ‘p’ is 20, and ‘v’ is x. So,

Final Value = 7 + x – 20

Given that the final value is 5, we can set up the equation:

5 = 7 + x – 20

Now, solve for ‘x’:

x = 5 – 7 + 20
x = 18

So, the value of ‘x’ is 18.

5 1 vote
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!