Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Search results for semaphore
18
votes
2
answers
1
GATE CSE 2023 | Question: 28
Consider the two functions $\textsf{incr}$ and $\textsf{decr}$ shown below. incr(){ decr(){ wait(s); wait(s); X = X+1; X = X-1; signal(s); signal(s); } } There are $5$ threads each invoking $\textsf{incr}$ once, and $3$ threads each ... of the following choices corresponds to the minimum possible values of $\text{V1, V2},$ respectively? $15,7$ $7,7$ $12,7$ $12,8$
Consider the two functions $\textsf{incr}$ and $\textsf{decr}$ shown below. incr(){ decr(){ wait(s); wait(s); X = X+1; X = X-1; signal(s); signal(s); } }There are $5$ thr...
admin
12.4k
views
admin
asked
Feb 15, 2023
Operating System
gatecse-2023
operating-system
semaphore
2-marks
+
–
26
votes
5
answers
2
GATE CSE 1992 | Question: 02,x, ISRO2015-35
At a particular time of computation, the value of a counting semaphore is $7$. Then $20$ $P$ operations and $15$ $V$ operations were completed on this semaphore. The resulting value of the semaphore is : $42$ $2$ $7$ $12$
At a particular time of computation, the value of a counting semaphore is $7$. Then $20$ $P$ operations and $15$ $V$ operations were completed on this semaphore. The resu...
Kathleen
24.0k
views
Kathleen
asked
Sep 12, 2014
Operating System
gate1992
operating-system
semaphore
easy
isro2015
process-synchronization
+
–
68
votes
8
answers
3
GATE CSE 2008 | Question: 63
The $P$ and $V$ operations on counting semaphores, where s is a counting semaphore, are defined as follows: $P(s):$ $s=s-1;$ If $s < 0$ then wait; $V(s):$ $s=s+1;$ If $s \leq0$ then wake up process waiting on s; Assume that $P_b$ and $V_b$ the wait ... $x_b$ and $y_b$ are respectively $0$ and $0$ $0$ and $1$ $1$ and $0$ $1$ and $1$
The $P$ and $V$ operations on counting semaphores, where s is a counting semaphore, are defined as follows:$P(s):$$s=s-1;$If $s < 0$ then wait;$V(s):$$s=s+1;$If $s \leq0$...
Kathleen
23.2k
views
Kathleen
asked
Sep 12, 2014
Operating System
gatecse-2008
operating-system
normal
semaphore
+
–
21
votes
4
answers
4
GATE CSE 2021 Set 1 | Question: 46
Consider the following pseudocode, where $\textsf{S}$ is a semaphore initialized to $5$ in line $\#2$ and $\textsf{counter}$ is a shared variable initialized to $0$ in line $\#1$. Assume that the increment operation in line $\#7$ ... is $0$ after all the threads successfully complete the execution of $\textsf{parop}$ There is a deadlock involving all the threads
Consider the following pseudocode, where $\textsf{S}$ is a semaphore initialized to $5$ in line $\#2$ and $\textsf{counter}$ is a shared variable initialized to $0$ in li...
Arjun
13.5k
views
Arjun
asked
Feb 18, 2021
Operating System
gatecse-2021-set1
multiple-selects
operating-system
process-synchronization
semaphore
2-marks
+
–
51
votes
10
answers
5
GATE CSE 2016 Set 2 | Question: 49
Consider a non-negative counting semaphore $S$. The operation $P(S)$ decrements $S$, and $V(S)$ increments $S$. During an execution, $20$ $P(S)$ operations and $12$ $V(S)$ operations are issued in some order. The largest initial value of $S$ for which at least one $P(S)$ operation will remain blocked is _______
Consider a non-negative counting semaphore $S$. The operation $P(S)$ decrements $S$, and $V(S)$ increments $S$. During an execution, $20$ $P(S)$ operations and $12$ $V(S)...
Akash Kanase
15.9k
views
Akash Kanase
asked
Feb 12, 2016
Operating System
gatecse-2016-set2
operating-system
semaphore
normal
numerical-answers
+
–
5
votes
1
answer
6
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 49
We want to use semaphores to implement a shared critical section (CS) among three threads $\mathrm{T} 1$, $\mathrm{T} 2$, and $\mathrm{T} 3$ ... What is the minimum number of binary semaphores we need in order to enforce this ordering?
We want to use semaphores to implement a shared critical section (CS) among three threads $\mathrm{T} 1$, $\mathrm{T} 2$, and $\mathrm{T} 3$.We want to enforce the execut...
GO Classes
482
views
GO Classes
asked
Jan 28
Operating System
goclasses2024-mockgate-13
goclasses
numerical-answers
operating-system
process-synchronization
semaphore
2-marks
+
–
12
votes
3
answers
7
GATE CSE 2022 | Question: 9
Consider the following threads, $\text{T}_{1}, \text{T}_{2},$ and $\text{T}_{3}$ executing on a single processor, synchronized using three binary semaphore variables, $\text{S}_{1}, \text{S}_{2},$ and $\text{S}_{3},$ operated upon using standard $\textsf{wait}()$ ... $\text{S}_{1} = 0; \text{S}_{2} = 1; \text{S}_{3} = 1$
Consider the following threads, $\text{T}_{1}, \text{T}_{2},$ and $\text{T}_{3}$ executing on a single processor, synchronized using three binary semaphore variables, $\t...
Arjun
9.1k
views
Arjun
asked
Feb 15, 2022
Operating System
gatecse-2022
operating-system
process-synchronization
semaphore
1-mark
+
–
4
votes
2
answers
8
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 19
Consider three concurrently executing threads in the same process using two semaphores $\text{s}1$ and $\text{s2}.$ Assume $\text{s1}$ has been initialized to $1$, while $\text{s2}$ has been initialized to $0.$ ... ); /* thread C */ P(s1); x = x+3; V(s2); V(s1); $6$ $12$ $18$ $36$
Consider three concurrently executing threads in the same process using two semaphores $\text{s}1$ and $\text{s2}.$ Assume $\text{s1}$ has been initialized to $1$, while ...
GO Classes
587
views
GO Classes
asked
Jan 13
Operating System
goclasses2024-mockgate-11
goclasses
operating-system
semaphore
threads
multiple-selects
1-mark
+
–
0
votes
1
answer
9
Semaphores
Can a counting semaphore acquire a negative value? S = 2; 15 P operations done, should the semaphore be 0 or -13
Can a counting semaphore acquire a negative value?S = 2;15 P operations done, should the semaphore be 0 or -13
Mrityudoot
246
views
Mrityudoot
asked
Jan 27
Operating System
semaphore
operating-system
process-synchronization
+
–
0
votes
0
answers
10
Operating system binary semaphores
Find initial values of binary semaphores X and Y. P and V operation for counting semaphore b is defined as: P(b): b--; wait if b<0; V(b): b++; wakeup any waiting process in b if b<=0; Pa (wait) and Va (signal) are implemented as: P(b): Pa(Y); b--; if(b<0) { Va(Y); Pa(X); } else Va(Y); V(b): Pa(Y); b++; if(b<=0) { Va(Y); Va(X); }
Find initial values of binary semaphores X and Y. P and V operation for counting semaphore b is defined as:P(b): b ; wait if b<0;V(b): b++; wakeup any waiting process in ...
jasper
383
views
jasper
asked
Oct 21, 2023
Others
operating-system
semaphore
binary-tree
+
–
19
votes
3
answers
11
GATE CSE 2020 | Question: 34
Each of a set of $n$ processes executes the following code using two semaphores $a$ and $b$ initialized to $1$ and $0$, respectively. Assume that $\text{count}$ is a shared variable initialized to $0$ ... all processes execute CODE SECTION P mutually exclusively. It ensures that at most $n-1$ processes are in CODE SECTION P at any time.
Each of a set of $n$ processes executes the following code using two semaphores $a$ and $b$ initialized to $1$ and $0$, respectively. Assume that $\text{count}$ is a shar...
Arjun
13.8k
views
Arjun
asked
Feb 12, 2020
Operating System
gatecse-2020
operating-system
semaphore
2-marks
+
–
0
votes
1
answer
12
process synchronization
How to approach synchronization (specifically semaphore) question, there size are really intimidating and i’m unable to decode the code written? What to do??
How to approach synchronization (specifically semaphore) question, there size are really intimidating and i’m unable to decode the code written? What to do??
N3314nch41
362
views
N3314nch41
asked
Sep 10, 2023
Operating System
process-synchronization
operating-system
semaphore
critical-section
self-doubt
+
–
0
votes
1
answer
13
NPTEL : Synchronisation (semaphore)
In a certain application, the initial value of a counting semaphore s is 10. The following operations were completed on the semaphore in the given order 5P, 20P, 2V, 18P, 5V, 10P, 1V. The new value of counting semaphore is _____________ ?
In a certain application, the initial value of a counting semaphore s is 10. The following operations were completed on the semaphore in the given order 5P, 20P, 2V, 18P,...
roopkathaaa
1.3k
views
roopkathaaa
asked
Aug 25, 2023
Operating System
operating-system
semaphore
+
–
0
votes
1
answer
14
OS handout
Let m[0]…m[4] be mutexes (binary semaphores) and P[0] …. P[4] be processes. Suppose each process P[i] executes the following: P(i) { while(1) { P(m[i]); P(m[(i+1)%4]; <CS> V(m[i]); V(m[(i+1)%4]; } } What is the maximum no. Of processes that can be in<CS> .......
Let m[0]…m[4] be mutexes (binary semaphores) and P[0] …. P[4] be processes.Suppose each process P[i] executes the following:P(i){ while(1) { P(m[i]); ...
Aniket1710
446
views
Aniket1710
asked
Jul 20, 2023
Operating System
semaphore
+
–
14
votes
11
answers
15
ISRO2015-30
Semaphores are used to solve the problem of Race Condition Process Synchronization Mutual Exclusion None of the above I and II II and III All of the above None of the above
Semaphores are used to solve the problem ofRace ConditionProcess SynchronizationMutual ExclusionNone of the aboveI and IIII and IIIAll of the aboveNone of the above
ajit
21.6k
views
ajit
asked
Oct 12, 2015
Operating System
semaphore
isro2015
process-synchronization
+
–
0
votes
1
answer
16
GATE CSE 2023 | Memory Based Question: 19
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() ... $s=2$ minimum possible value of $\mathrm{x}$ is $\mathrm{V}_2$ $15,8$ $12,8$ $15,7$ $12,7$
incr(){ wait(s) x = x+1 signal(s) } decr() { wait(s) x = x–1 signal(s) }Shared integer variable $\mathrm{x}$ initialized w...
GO Classes
1.6k
views
GO Classes
asked
Feb 5, 2023
Operating System
memorybased-gatecse2023
goclasses
operating-system
process-synchronization
binary-semaphore
+
–
0
votes
0
answers
17
OS Self doubt (Semaphore)
At the end of chapter 2, we studied a solution to the readers and writers problem, given below:- In this solution, as long as one reader is having the resource any new reader can get access to the resource. Thus, the writer will ... expressing interest the writer will also have to wait for all the existing resource-occupyingreader(s) to be done and release the resource.
At the end of chapter 2, we studied a solution to the readers and writers problem, given below:-In this solution, as long as one reader is having the resource any new rea...
legacy
316
views
legacy
asked
Nov 27, 2022
Operating System
self-doubt
semaphore
+
–
0
votes
1
answer
18
Process Synchronisation
What is the significance of infinite loop that is written in every example of process synchronisation? What would happen if there wasn't any infinite loop?
What is the significance of infinite loop that is written in every example of process synchronisation? What would happen if there wasn't any infinite loop?
ajayraho
911
views
ajayraho
asked
Oct 23, 2022
Operating System
operating-system
process-synchronization
semaphore
process-scheduling
inter-process-communication
+
–
2
votes
1
answer
19
Binary Semaphore
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 T2 :-Y has performed V(R); Will Process X get unblocked and removed from ready queue? Which process will run after Y has performed V(R)? Process Y or Process X?
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...
subhashchaganti
520
views
subhashchaganti
asked
Sep 21, 2022
Operating System
operating-system
binary-semaphore
queue
+
–
To see more, click for the
full list of questions
or
popular tags
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register