549 views
1 votes
1 votes
What happens if signal() is performed on a binary semaphore which is already set to 1.

sem mutex = 1;

signal(mutex)

// cs

1 Answer

1 votes
1 votes
As it is binary semaphore ,its value remain 1 on signal() operation

Every process that wants to enter into critical section always enters critical section.

It's just like opening a lock which is already opened.

Related questions

1 votes
1 votes
1 answer
1
Rahul_Rathod_ asked Dec 12, 2018
1,507 views
a) s1-wait(p) , s2-wait(q) , s3-wait(q) , s4-wait(p)b) s1-wait(p) , s2-wait(q) , s3-wait(p) , s4-wait(q)c) s1-wait(q) , s2-wait(p) , s3-wait(p) , s4-wait(q)d) none of...
0 votes
0 votes
0 answers
2
1 votes
1 votes
0 answers
4
srestha asked Oct 4, 2018
1,067 views
Will it causing deadlock? How do we fixed it?P1: P2: Wait(S); Wait(Q); Wait(Q); Wait(S); ........ ............. Signal(S); Signal(Q); Signal(Q); Signal(S);