Recent questions tagged binary-semaphore

1 1 vote
2 2 answers
132
132 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{...
2 2 votes
0 0 answers
569
569 views
Consider a counting semaphore s1 initialized to two. The binary semaphore s2 is initialized to one. There are three processes executing the following code segment concurr...
0 0 votes
1 1 answer
2.9k
2.9k views
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 thread...
2 2 votes
1 answers 1 answer
851
851 views
Say there is a Binary semaphore R, initialized to 0. Say process X and Y are working on R.At T1 :- X has performed P(R); X gets blocked and gets added in Process Queue.At...
1 1 vote
2 2 answers
922
922 views
Let S be the binary semaphore variable initialized to zero. If no blocked processes exist in the system then consider the execution of the following signal (V), wait (P) ...
2 2 votes
1 1 answer
869
869 views
Suppose we want to synchronize two concurrent processes P and Q
3 3 votes
1 answers 1 answer
1.0k
1.0k views
Let S be a binary semaphore variable. Let S = 0 initially. Assume that no blocked processes exist in the system. The following signal (V), wait (P) operations are perform...
1 1 vote
1 1 answer
2.5k
2.5k 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...
2 2 votes
1 1 answer
1.5k
1.5k views
Consider a non-negative counting semaphore S. During an execution, 16P (wait) operations, and 4V (signal) operations are issued in some order. The largest initial value o...
0 0 votes
1 1 answer
1.5k
1.5k views
What is the actual difference between binary semaphore & Mutex????? Are both same thing????What is the up() code for binary semaphore?????
0 0 votes
0 0 answers
649
649 views
HOW ARE THE CURRENT OPERATORS CREATING DEADLOCK HERE?
0 0 votes
0 0 answers
732
732 views
The number of binary semaphores required to implement readers-writers code in busy waiting mode is - answer given as 1.why 1 and why not 2?
0 0 votes
2 2 answers
4.8k
4.8k views
struct Semaphore { enum value(0,1); Queue type L; } Down (Semaphore S) { if(S.value==1) { S.value=0; } else { put process(PCB) in S.L; sleep(); } } Up(Semaphore S) { if(S...
3 3 votes
2 answers 2 answers
4.6k
4.6k views
Q : Each process Pi , i = 1 to 9 executes the following code : while (TRUE) { P(mutex); Critical section ; V(mutex);}The process P10 executes the foll...
1 1 vote
2 answers 2 answers
3.9k
3.9k views
In order to allow only one process to enter its critical section, binary semaphore are initialized to$0$$1$ $2$$3$
4 4 votes
4 4 answers
4.8k
4.8k views
A Binary semaphore variable mutex is initialized to '1' and the various binary semaphore operations like 9P(), 14V(), 6P(), 8V(), 3P(), 2V() are performed, then what is t...
To see more, click for the full list of questions or popular tags.