Login
Register
Dark Mode
Brightness
Ambient Glow – Questions list
Register
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged semaphore
2
2 votes
1
1 answer
161
161 views
GO Classes DPP | GATE CS | Operating System | Semaphore Atomicity
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...
GO Classes
161
views
asked
Aug 26
Operating System
goclasses
goclasses-cs-dpp
operating-system
goclasses-cs-dpp-day-357
goclasses-os-practice-questions
semaphore
multiple-selects
+
–
3
3 votes
1
1 answer
181
181 views
GO Classes DPP | GATE CS | Operating System | Producer-Consumer Semaphores
A bounded buffer has capacity $6$ and is initially empty.The semaphore values are initially:$\texttt{empty} = 6$$\texttt{full} = 0$$\texttt{mutex} = 1$During execution:$9...
GO Classes
181
views
asked
Aug 3
Operating System
goclasses
goclasses-cs-dpp
operating-system
goclasses-cs-dpp-day-338
goclasses-os-practice-questions
producer-consumer
semaphore
+
–
5
5 votes
2
2 answers
160
160 views
GO Classes DPP | GATE CS | Operating System | Buffer Occupancy
A bounded buffer has capacity $5$ and is initially empty.During an execution:$8$ producer insertions complete. $5$ consumer removals complete.Assume no insertion or remov...
GO Classes
160
views
asked
Jul 29
Operating System
goclasses
goclasses-cs-dpp
operating-system
goclasses-cs-dpp-day-336
goclasses-os-practice-questions
semaphore
numerical-answers
+
–
3
3 votes
1
1 answer
128
128 views
GO Classes DPP | GATE CS | Operating System | Bounded Buffer
A producer-consumer system uses a buffer containing $N$ slots.The semaphores are:$\texttt{empty}$, representing empty slots $\texttt{full}$, representing filled slots $\t...
GO Classes
128
views
asked
Jul 29
Operating System
goclasses
goclasses-cs-dpp
operating-system
goclasses-cs-dpp-day-336
goclasses-os-practice-questions
semaphore
+
–
3
3 votes
2
2 answers
145
145 views
GO Classes DPP | GATE CS | Operating System | Semaphore Properties
Which of the following statements are correct?Semaphore $\texttt{wait()}$ and $\texttt{signal()}$ operations must be atomic. A counting semaphore can represent the number...
GO Classes
145
views
asked
Jul 29
Operating System
goclasses
goclasses-cs-dpp
operating-system
goclasses-cs-dpp-day-335
goclasses-os-practice-questions
semaphore
multiple-selects
+
–
4
4 votes
3
3 answers
180
180 views
GO Classes DPP | GATE CS | Operating System | Semaphore Operation Trace
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)...
GO Classes
180
views
asked
Jul 29
Operating System
goclasses
goclasses-cs-dpp
operating-system
goclasses-cs-dpp-day-335
goclasses-os-practice-questions
semaphore
+
–
4
4 votes
2
2 answers
146
146 views
GO Classes DPP | GATE CS | Operating System | Semaphore Ordering
Two concurrent processes execute:Process A$A_1$$A_2$$A_3$$A_4$Process B$B_1$$B_2$$B_3$$B_4$A semaphore $S$ is initialized to $0$.The requirement is that $A_2$ must comple...
GO Classes
146
views
asked
Jul 29
Operating System
goclasses
goclasses-cs-dpp
operating-system
goclasses-cs-dpp-day-335
goclasses-os-practice-questions
semaphore
+
–
21
21 votes
5
5 answers
2.9k
2.9k views
GATE CSE 2026 | Set 2 | Question: 41
Consider three processes $\text{P1, P2}$, and $\text{P3}$ running identical code, as shown in the pseudocode below. $\text{A}$ and $\text{B}$ are two binary semaphores in...
gatecse
2.9k
views
asked
Feb 23
Operating System
gatecse-2026-set2
operating-system
semaphore
multiple-selects
two-marks
+
–
0
0 votes
0
0 answers
286
286 views
Process Synchronisation
The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows:void enter_CS(x) { while (test-a...
Vishnu__
286
views
asked
Feb 4
Operating System
operating-system
semaphore
critical-section
multiple-selects
+
–
0
0 votes
0
0 answers
486
486 views
UGC NET CSE | June 2025 | Part 2 | Question: 63
Identify the correct statement(s) from the followings with respect to Spinlock SemaphoresThe name refers to busy waiting semaphores.They are not useful when the locks are...
Shubham Sharma 2
486
views
asked
Sep 10, 2025
Operating System
ugcnetcse-june2025
operating-system
process-synchronization
semaphore
+
–
0
0 votes
1
1 answer
473
473 views
test series please solve this
What is the value of n after 10 concurrent threads terminate, where initially value of counting semaphore s = 2 and n=0?Thread Tk:int x;wait(s);x = n;n = x + 1;signal(s);...
pinku singh
473
views
asked
Jul 25, 2025
Operating System
operating-system
semaphore
+
–
0
0 votes
1
1 answer
368
368 views
GO Classes Test Series 2025 | NIELIT Mock Test 1 | Question: 105
Consider the following three threads and four semaphores.$s 1, s 2, s 3, s 4$ are counting semaphores and $x$ is a shared variable initialized as $1.$The goal is to initi...
GO Classes
368
views
asked
May 5, 2025
Others
goclasses2025-nielit-mock-1
goclasses
operating-system
semaphore
threads
one-mark
+
–
2
2 votes
1
1 answer
275
275 views
GO Classes | IIITH PGEE 2026 Mock Test 12 | Question: 77
Consider the following three threads and four semaphores.$s 1, s 2, s 3, s 4$ are counting semaphores and $x$ is a shared variable initialized as $1.$The goal is to initi...
GO Classes
275
views
asked
Mar 20, 2025
Operating System
goclasses2026-iiith-mock-12
goclasses
one-mark
operating-system
semaphore
+
–
1
1 vote
0
0 answers
728
728 views
Gate Cs 2004 Q48 (approach to solve)
Rather than the solution, my question is how do we approach these kind of questions? Do we always consider the case where two processes execute at the same speed(like 1 l...
baho1212
728
views
asked
Jan 15, 2025
Operating System
process-synchronization
semaphore
+
–
0
0 votes
2
2 answers
321
321 views
#self doubt
can someone please explain the exact difference between binary semaphores and mutex?not able to find any simple explanation.
Dknights
321
views
asked
Dec 7, 2024
Operating System
operating-system
semaphore
self-doubt
+
–
2
2 votes
0
0 answers
575
575 views
Counting Semaphore: IIT Kanpur
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...
RUPALI_SHAHAPURE
575
views
asked
Nov 15, 2024
Operating System
operating-system
semaphore
binary-semaphore
iit-kanpur
+
–
0
0 votes
1
1 answer
407
407 views
ISI2024-MCS-PCB (CS) | Question: 9
Let $P_{1}, P_{2}, \ldots, P_{20}$ be a set of 20 cooperating processes, all of which have access to a shared integer X. For $i \in\{1,2, \ldots, 20\}$, the process $P_{i...
admin
407
views
asked
Sep 16, 2024
Operating System
isi2024-mcs-pcb-cs
process-synchronization
semaphore
operating-system
programming-in-c
+
–
0
0 votes
1
answers
1 answer
1.0k
1.0k views
Semaphores
Can a counting semaphore acquire a negative value?S = 2;15 P operations done, should the semaphore be 0 or -13
Mrityudoot
1.0k
views
asked
Jan 27, 2024
Operating System
semaphore
operating-system
process-synchronization
+
–
Page:
1
2
3
4
5
6
7
next »