Skip site navigation (1) Skip section navigation (2)

Re: Posix Shared Mem patch

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Posix Shared Mem patch
Date: 2012-06-28 13:57:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Thu, Jun 28, 2012 at 9:47 AM, Jon Nelson <jnelson+pgsql(at)jamponi(dot)net> wrote:
> Why not just mmap /dev/zero (MAP_SHARED but not MAP_ANONYMOUS)?  I
> seem to think that's what I did when I needed this functionality oh so
> many moons ago.

From the reading I've done on this topic, that seems to be a trick
invented on Solaris that is considered grotty and awful by everyone
else.  The thing is that you want the mapping to be shared with the
processes that inherit the mapping from you.  You do *NOT* want the
mapping to be shared with EVERYONE who has mapped that file for any
reason, which is the usual meaning of MAP_SHARED on a file.  Maybe
this happens to work correctly on some or all platforms, but I would
want to have some convincing evidence that it's more widely supported
(with the correct semantics) than MAP_ANON before relying on it.

Robert Haas
The Enterprise PostgreSQL Company

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2012-06-28 13:59:38
Subject: Re: Posix Shared Mem patch
Previous:From: Robert HaasDate: 2012-06-28 13:53:46
Subject: Re: We probably need autovacuum_max_wraparound_workers

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group