Questions tagged [semaphore]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
33 views

How are semaphores and test-and-set instructions connected?

Cheers, so my textbook explains these parts very poorly, so I would gladly take any advice! I am confused between the test-and-set instructions, which per my book is a very common CPU instruction set, ...
0
votes
0answers
10 views

How to enforce synchronization with two semaphores

Assume I have 4 threads, A B C D respectively. A finishes before B starts. B finishes before C or D start. How should I initial values and synchronize threads with 2 semaphores?
0
votes
1answer
19 views

How to trigger a thread to start working using semaphore?

How to trigger a thread to start working using semaphore? I have find a lot of explanation about thread and semaphore but i still don't understand, any help please
0
votes
1answer
24 views

Process synchronization problem

The atomic fetch-and-set x,y instruction unconditionally sets the memory location x to 1 and fetches the old value of x in y without allowing any intervening access to the memory location x. Consider ...
0
votes
1answer
36 views

When does a semaphore issue a wait and when does it issue a signal?

In my textbook, Operating Systems: Internals and Design Principles (9th Edition) by William Stallings in chapter 5, it explains how semaphores work: The fundamental principle is this: Two or more ...
1
vote
0answers
24 views

Comparing wait-signal alternatives for synchronizing two piece of programs

I came across following problem: A certain computation generates two arrays a and b such that ...
2
votes
1answer
91 views

Designing solution to critical section problem with two semaphores vs single semaphore

I came across following problem: Let two processes P1 and P2 are there: ...
2
votes
0answers
26 views

Does this state certify to be called as a deadlock?

I came across following problem: Barrier is a synchronization construct where a set of processes synchronizes globally i.e., each process in the set arrives at the barrier and waits for all others ...