incr()
{
wait(s)
x = x+1
signal(s)
}
decr()
{
wait(s)
x = x–1
signal(s)
}
Shared integer variable $\mathrm{x}$ initialized with $10.$
There are five threads which are calling incr() and there are three threads which are calling decr().
For binary semaphore $\mathrm{s}=1$ minimum possible value of $\mathrm{x}$ is $\mathrm{V}_1$
For counting semaphore $s=2$ minimum possible value of $\mathrm{x}$ is $\mathrm{V}_2$
- $15,8$
- $12,8$
- $15,7$
- $12,7$