Re: PostgreSQL performance on FreeBSD

From: Jilles Tjoelker <jilles_at_stack.nl>
Date: Fri, 24 Jun 2016 00:31:43 +0200
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
Received on Thu Jun 23 2016 - 20:31:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:06 UTC