There are three processes $P_{1}, P_{2}$ and $P_{3}$ sharing a semaphore for synchronizing a variable. Initial value of semaphore is one. Assume that negative value of semaphore tells us how many processes are waiting in queue. Processes access the semaphore in following order :
- $P2$ needs to access
- $P1$ needs to access
- $P3$ needs to access
- $P2$ exits critical section
- $P1$ exits critical section
The final value of semaphore will be :
- $0$
- $1$
- $-1$
- $-2$