Re: dynamically allocating chunks from shared memory - Mailing list pgsql-hackers

From Tom Lane
Subject Re: dynamically allocating chunks from shared memory
Date
Msg-id 13346.1281385106@sss.pgh.pa.us
Whole thread Raw
In response to Re: dynamically allocating chunks from shared memory  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: dynamically allocating chunks from shared memory
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Aug 9, 2010 at 3:20 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It's not portable. �That's exactly what we were looking into back when.

> Uggh, that sucks.  Can you provide any more details?

You don't really have to go further than consulting the relevant
standards, eg SUS says at
http://www.opengroup.org/onlinepubs/007908799/xsh/mmap.html
If the size of the mapped file changes after the call to mmap() as aresult of some other operation on the mapped file,
theeffect ofreferences to portions of the mapped region that correspond to addedor removed portions of the file is
unspecified.

Particular implementations might cope with such cases in useful ways, or
then again they might not.  And even if your platform does, you've set
an upper limit for the possible segment size in your mmap() call.

Further down the page, SUS also takes pains to point out that you
probably can't have an unlimited number of mapped regions, so adding
more mmap'd segments isn't a way out either.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: patch: to_string, to_array functions
Next
From: Merlin Moncure
Date:
Subject: Re: patch: to_string, to_array functions