Recent questions tagged semaphore

26 26 votes
4 answers 4 answers
18.0k
18.0k views
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...
0 0 votes
0 0 answers
1.1k
1.1k views
given solution is wait(P) , wait(Q), wait(p) , wait(Q) for s1,s2,s3,s4 respectivelyI know this implementation is deadlock free just want to ask if it will follow bounded ...
1 1 vote
2 2 answers
1.6k
1.6k views
If the P() and V() semaphore operations are not executed atomically, then which of the following are always correct?Mutual exclusion satisfied Progress is not satisfiedBo...
0 0 votes
1 1 answer
918
918 views
A protected variable which can be accessed and changed by particular set of operation is called $:$interrupt monitorsemaphore$\text{IPC}$
2 2 votes
1 1 answer
1.0k
1.0k views
It is given that in a system, processes P and C communicate by means of 3 semaphores and one buffer. The buffer size is given as 10. A semaphore M is used to implement mu...
0 0 votes
2 2 answers
1.4k
1.4k views
A counting semaphore is initialized to $8$. $3$ wait ( ) operations and $4$ signal ( ) operations are applied. Find the current value of semaphore variable.$9$$5$$1$$4$
58 58 votes
7 answers 7 answers
29.1k
29.1k views
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...
0 0 votes
1 1 answer
774
774 views
_______synchronize critical resources to prevent deadlock.$P$- operator$V$- operatorSemaphoresHard disk
0 0 votes
2 2 answers
1.6k
1.6k views
Semaphores are used to :Synchronise critical resources to prevent deadlockSynchronise critical resources to prevent contentionDo I/oFacilitate memory management
0 0 votes
2 2 answers
3.6k
3.6k views
Producer consumer problem can be solved using :semaphoresevent countersmonitorsall the above
2 2 votes
5 answers 5 answers
4.4k
4.4k views
There are three processes $P_{1}, P_{2}$ and $P_{3}$ sharing a semaphore for synchronizing a variable. Initial value of semaphore is one. Assume that negative value of se...
41 41 votes
5 answers 5 answers
26.6k
26.6k views
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...
5 5 votes
4 4 answers
9.4k
9.4k views
The hardware implementation which provides mutual exclusion isSemaphoresTest and set instructionsBoth optionsNone of the options
0 0 votes
0 0 answers
936
936 views
A student majoring in anthropology and minoring in computer science has embarked on a research project to see if African baboons can be taught about deadlocks. He locates...
1 1 vote
0 0 answers
563
563 views
The objective of this exercise is to implement a multithreaded solution to find if a given number is a perfect number. $N$ is a perfect number if the sum of all its facto...
0 0 votes
0 0 answers
981
981 views
Write a producer-consumer problem that uses threads and shares a common buffer. However, do not use semaphores or any other synchronization primitives to guard the shared...
0 0 votes
0 0 answers
1.0k
1.0k views
Suppose that a university wants to show off how politically correct it is by applying the U.S. Supreme Court’s ‘‘Separate but equal is inherently unequal’’ doctrine to ge...
0 0 votes
0 0 answers
685
685 views
Solve the dining philosophers problem using monitors instead of semaphores.
0 0 votes
0 0 answers
550
550 views
Assume that you have an operating system that provides semaphores. Implement a message system. Write the procedures for sending and receiving messages.
0 0 votes
1 1 answer
1.0k
1.0k views
Synchronization within monitors uses condition variables and two special operations, wait and signal. A more general form of synchronization would be to have a single pri...
0 0 votes
0 0 answers
499
499 views
Can two threads in the same process synchronize using a kernel semaphore if the threads are implemented by the kernel? What if they are implemented in user space? Assume ...
0 0 votes
1 1 answer
1.5k
1.5k views
How could an operating system that can disable interrupts implement semaphores?
1 1 vote
2 2 answers
2.0k
2.0k views
Why in reader section we are locking(I highlighted the locking) read_count and if section?If we don't use locking what problems might arise?I know that we should use loc...
0 0 votes
0 0 answers
1.8k
1.8k views
Galvin, 9th edition on page 146 states that“Shared memory can be faster than message passing, since message-passing systems are typically implemented using system calls a...
1 1 vote
1 1 answer
1.9k
1.9k views
a)Mutual exclusion, progress, bounded wait all are satisfiedb)Mutual exclusion, progress satisfied but bounded wait not satisfiedc)Mutual exclusion satisfied progress, bo...