3,364 views
1 1 vote
Let S be a binary semaphore variable and value of S=0 what will be the value of S when following operations are executed on semaphore S

2P,4V,5P,2P,8V,3P,2V

I’m getting the answer as 0, but it is given 1

Please explain in details

Please log in or register to answer this question.

Position:
Show:

Related questions

2 2 votes
1 1 answer
163
163 views
GO Classes asked Aug 26
163 views
Consider an integer semaphore $\texttt{S}$.Method $\textbf{1}$wait(S): disable interrupts while S <= 0: do nothing S = S - 1 enable interrupts signal(S): disable interrup...
3 3 votes
2 2 answers
147
147 views
GO Classes asked Jul 29
147 views
Which of the following statements are correct?Semaphore $\texttt{wait()}$ and $\texttt{signal()}$ operations must be atomic. A counting semaphore can represent the number...
4 4 votes
3 3 answers
181
181 views
GO Classes asked Jul 29
181 views
A semaphore $S$ is initialized to $1$.The following operations occur in order:$\texttt{wait(S)}$$\texttt{wait(S)}$$\texttt{signal(S)}$$\texttt{wait(S)}$$\texttt{signal(S)...
2 2 votes
2 2 answers
155
155 views
GO Classes asked Jul 29
155 views
Two semaphores are initialized as:$S = 1$$T = 0$Two processes execute repeatedly:Process P$\texttt{wait(S);}$$\texttt{print("A");}$$\texttt{signal(T);}$Process Q$\texttt{...