Top "Semaphore" questions

A semaphore is a synchronization primitive that tracks how many of a limited number of resources are available.

How and why can a Semaphore give out more permits than it was initialized with?

I am reading the book Java Concurrency in Practice. In a section about java.util.concurrent.Semaphore, the below lines …

java multithreading concurrency semaphore
sem_init(…): What is the value parameter for?

In a class, we've had to use semaphores to accomplish work with threads. The prototype (and header file) of sem_…

multithreading semaphore
Need to semaphore.relase() if semaphore.acquire() gets InterruptedException?

From the Java java.util.concurrent.Semaphore docs it wasn't quite clear to me what happens if semaphore.acquire() blocks …

java semaphore interrupted-exception
System-wide global variable / semaphore / mutex in C++/Linux?

Is it possible to create a system-wide global variable / semaphore / mutex in C++ on Linux? Here's the reason: I've got …

c++ linux concurrency mutex semaphore
Does SemaphoreSlim (.NET) prevent same thread from entering block?

I have read the docs for SemaphoreSlim SemaphoreSlim MSDN which indicates that the SemaphoreSlim will limit a section of code …

c# .net async-await semaphore reentrancy
Understanding semaphores

I am reading about semaphores in "Operating System Concepts" (for those of you who know it), and I thought I …

semaphore critical-section
What are the differences among mutex, semaphore and read write locks

Any real-time scenarios explaining on each would be appreciated. Is there any other way to handle synchronization apart from these …

mutex semaphore readerwriterlock
possibility of starvation of Dining Philosophers

I need to check my algorithm of solving the dining philosopher problem if it guarantees that all of the following …

c algorithm semaphore dining-philosopher
Mutual exclusion and semaphores

I am writing a program (for homework) that simulates a unisex bathroom. Only 4 people are allowed at a time and …

c++ mutex semaphore
Differences between <semaphore.h> and <sys/sem.h>

What are the differences between the functions included in <semaphore.h> and <sys/sem.h>? Does …

c posix semaphore