Issue #2337 has been updated by nthery.

Status changed from New to In Progress
Assignee set to nthery

I've got an skeleton prototype roughly similar to the fbsd implementation.

Semaphore names are regular files.  Each semaphore has a system-wide state, 
basically its value, stored in a shared memory region.  There is also a 
per-process state for dealing with multiple sem_open() calls.

The semaphore value is manipulated via atomic instructions.  sem_wait() calls 
into the kernel (umtx_sleep()) if and only if the calling thread must sleep 
(semaphore value < 0).  Similarly sem_post() calls into the kernel 
(umtx_wakeup()) if and only if there are waiters (value 0 ->1).  umtx_sleep() 
could be replaced in a subsequent step with a semaphore-optimized syscall for 
avoiding user<->kernel transitions when several threads concurrently call 
sem_wait() with value <= 0.

I'll post the code when fleshed out and cleaned up.

----------------------------------------
Bug #2337: Wishlist: We need named POSIX semaphores
http://bugs.dragonflybsd.org/issues/2337#change-11659

* Author: vsrinivas
* Status: In Progress
* Priority: Normal
* Assignee: nthery
* Category: 
* Target version: 
----------------------------------------
DragonFly is missing named POSIX semaphores (sem_open / sem_close / 
sem_unlink). python-multiprocessing, for example, needs this to work.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://bugs.dragonflybsd.org/my/account

Reply via email to