408 views
0 votes
0 votes
If a room have capacity of 20 persons...9 persons already inside the room....then what will be the value of semaphore integer.
A. 20
b. 9
c. 11
d. 29

1 Answer

Best answer
3 votes
3 votes

Depends on implementation- question is incomplete. 

Assuming a counting semaphore is used to indicate the availability of a space in the room we can do as follows:

Semaphore value x- denote x person can enter the room. 

So, initial value of semaphore here is 20 and when 9 person are inside, it becomes $20-9=11.$

selected by

Related questions

2 votes
2 votes
1 answer
1
gatecse asked Sep 15, 2014
1,719 views
A man visits a couple who have 2 children. one of the children, a boy, comes into the room. find the probability p that the other is also a boy.(a)1/3(b)2/3(c)1/2(d)3/4
0 votes
0 votes
2 answers
2
sripo asked Dec 25, 2018
4,788 views
In a 3-array tree if internal nodes have exactly 3 children,the number of leaf nodes will be __ ?Does it vary for binary tree?What do you mean by internal nodes? Non roo...
1 votes
1 votes
2 answers
3
learncp asked Aug 25, 2015
3,378 views
For what value of a, if any, will the following system of equations in x, y and z have asolution?2x + 3y = 4, x + y + z = 4, x + 2y – z = a(a) Any real number     (...