On Wed, Jun 22, 2016 at 07:26:52AM -0700, Maxim Sobolev wrote:
> Konstantin,

> Not if you do sem_unlink() immediately, AFAIK. And that's what PG does. So
> the window of opportunity for the leakage is quite small, much smaller than
> for SYSV primitives. Sorry for missing your status update message, I've
> missed it somehow.

True, but if your process architecture supports that, you can also put
unnamed process-shared semaphores into a piece of shared memory (pad
sem_t to a cache line if contention is expected). This is more natural
API use (fully avoiding the leak) and uses less memory. It has been
supported for a long time, at least since FreeBSD 9.0.

Process-shared mutexes, condition variables, reader/writer locks, etc.
are available in FreeBSD 11 but use more memory (a 1-page object per
synchronization object), somewhat like named semaphores.

-- 
Jilles Tjoelker
_______________________________________________
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to