Questions tagged [semaphore]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
82 views

How are waits in semaphores made atomic in nature?

I was going through the book Operating Systems by Galvin. First they explain Semaphores acting like a mutex. While talking about semaphores as mutex, they mention that the wait operation of semaphores ...
Himanshuman's user avatar
0 votes
0 answers
26 views

The signal operation can be implemented with spinlocks?

Here's a question about semaphore. (True/False) The signal operation can be implemented with spinlocks The answer is false, but I don't know why. I thought the ...
samli50801's user avatar
2 votes
1 answer
133 views

Tigers and elephants can't drink water from a pond simultaneously, while more than one tiger or more than one elephants can drink water simultaneously

Below is a question on synchronization mechanism which was asked in an interview in Indian Statistical Institute, M.Tech CS. I got hold of it from here. There is a forest where there are tigers and ...
Abhishek Ghosh's user avatar
5 votes
0 answers
74 views

Why semaphores lead to loss of modularity?

In this article Semaphores in Operating System and other articles on the internet, they have mentioned one of the disadvantages of semaphores is that it leads to loss of modularity. They further said ...
Aryan's user avatar
  • 151
0 votes
1 answer
111 views

What will you do if multiple users access your application at the same time?

I'm an experienced Software Engineer but very weak in concurrency because of no prior experience in that. I've been interviewing with several companies in which I was asked similar kinds of questions ...
KhiladiBhaiyya's user avatar
1 vote
1 answer
901 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, ...
average_discrete_math_enjoyer's user avatar
1 vote
1 answer
143 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
Lix's user avatar
  • 115
0 votes
1 answer
97 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 ...
Abhishek Kumar's user avatar
0 votes
1 answer
218 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 ...
Darien Springer's user avatar
1 vote
0 answers
27 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 ...
RajS's user avatar
  • 1,637
2 votes
1 answer
226 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: ...
RajS's user avatar
  • 1,637
2 votes
0 answers
38 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 ...
RajS's user avatar
  • 1,637