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
167
167 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
167
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
186
186 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
186
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
164
164 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
164
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
132
132 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
132
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
150
150 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
150
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
185
185 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
185
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
154
154 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
154
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
6
6 answers
3.0k
3.0k 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
3.0k
views
asked
Feb 23
Operating System
gatecse-2026-set2
operating-system
semaphore
multiple-selects
two-marks
+
–
0
0 votes
0
0 answers
287
287 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__
287
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
480
480 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
480
views
asked
Jul 25, 2025
Operating System
operating-system
semaphore
+
–
0
0 votes
1
1 answer
371
371 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
371
views
asked
May 5, 2025
Others
goclasses2025-nielit-mock-1
goclasses
operating-system
semaphore
threads
one-mark
+
–
2
2 votes
1
1 answer
276
276 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
276
views
asked
Mar 20, 2025
Operating System
goclasses2026-iiith-mock-12
goclasses
one-mark
operating-system
semaphore
+
–
1
1 vote
0
0 answers
732
732 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
732
views
asked
Jan 15, 2025
Operating System
process-synchronization
semaphore
+
–
0
0 votes
2
2 answers
323
323 views
#self doubt
can someone please explain the exact difference between binary semaphores and mutex?not able to find any simple explanation.
Dknights
323
views
asked
Dec 7, 2024
Operating System
operating-system
semaphore
self-doubt
+
–
2
2 votes
0
0 answers
576
576 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
576
views
asked
Nov 15, 2024
Operating System
operating-system
semaphore
binary-semaphore
iit-kanpur
+
–
0
0 votes
1
1 answer
412
412 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
412
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.1k
1.1k 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.1k
views
asked
Jan 27, 2024
Operating System
semaphore
operating-system
process-synchronization
+
–
Page:
1
2
3
4
5
6
7
next »