839 views
1 votes
1 votes

2 Answers

3 votes
3 votes

see the basic operation of  p1: enqueue and p2: dequeue 

statement 1: initial value of f is 0, and it cannot enter p2 until it executes p1. i.e, minimum 1 element should be there before dequeue operation. So this is correct.

statement 3: it can be observed for b that it is used for mutual exclusion. so this is also correct.

however statement 2 is not true for e. See that initial value of e is N. the purpose of semaphore e is to ensure the queue does't overflow. So statement 2 is false.

Hence answer (c)

Related questions

0 votes
0 votes
1 answer
1
Mrityudoot asked Jan 27
230 views
Can a counting semaphore acquire a negative value?S = 2;15 P operations done, should the semaphore be 0 or -13
1 votes
1 votes
1 answer
2
0 votes
0 votes
1 answer
3
Na462 asked Jul 19, 2018
568 views
0 votes
0 votes
1 answer
4
Na462 asked Jul 14, 2018
709 views