Top "Semaphore" questions

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

Are Semaphore P and V operations atomic?

Are the P() and V() operations that can be performed on a semaphore guarantee atomic? Can a semaphore prevent two …

multithreading concurrency semaphore
What's the proper way to wait on a Semaphore?

I thought that the following code would let all the 10 threads run, two at a time, and then print "done" …

c# .net multithreading semaphore waithandle
ubuntu: sem_timedwait not waking (C)

I have 3 processes which need to be synchronized. Process one does something then wakes process two and sleeps, which does …

c linux pthreads semaphore ubuntu-9.04
Fatal error: Call to undefined function sem_get()

I'm new to PHP and I'm trying to run code I got from someone else on my Windows development machine. …

php windows synchronization semaphore apache2.2
How to properly set timespec for sem_timedwait to protect against EINVAL error

I'm trying to use sem_timedwait() to repeatedly lock and unlock a semaphore. Based on the example here, I was …

c semaphore time.h
Dining Philosophers in C using fork()

I wrote a C program for the Dining Philosophers Problem using pthread some time ago and am now trying to …

c fork semaphore dup2 dining-philosopher
No such file found with semaphore.h and ucontext.h

I have my code here: #define _GNU_SOURCE #include "lib-ult.h" #include <stdio.h> #include <stdlib.h&…

c semaphore ucontext
Shared semaphore between user and kernel spaces

Short version Is it possible to share a semaphore (or any other synchronization lock) between user space and kernel space? …

c linux-kernel semaphore
Critical Section in JavaScript or jQuery

I have a webpage, in which a certain Ajax event is triggered asynchronously. This Ajax section could be called once …

javascript jquery semaphore critical-section mutual-exclusion
Wait for Task to Complete without Blocking UI Thread

I have a fairly complex WPF application that (much like VS2013) has IDocuments and ITools docked within the main shell …

c# asynchronous task semaphore blocking