Re: Feature: POSIX Shared memory support - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: Feature: POSIX Shared memory support
Date
Msg-id 61714.24.211.165.134.1170833233.squirrel@www.dunslane.net
Whole thread Raw
In response to Re: Feature: POSIX Shared memory support  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Feature: POSIX Shared memory support  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: Feature: POSIX Shared memory support  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-patches
Tom Lane wrote:
>
> We've speculated on occasion about using file locking in some form as a
> substitute mechanism for detecting this, but that seems to just bring
> its own set of not-too-portable assumptions.
>


Maybe we should look some more at that. Use of file locking was one
thought I had today after I saw Tom's earlier comments.

Perl provides a moderately portable flock(), which we use in fact in
buildfarm to stop it from running more than one at a time on a given repo
copy.

The Perl description starts thus:

   Calls flock(2), or an emulation of it, on FILEHANDLE.  Returns
   true for success, false on failure.  Produces a fatal error if
   used on a machine that doesn't implement flock(2), fcntl(2)
   locking, or lockf(3).  "flock" is Perl's portable file locking
   interface, although it locks only entire files, not records.

Note that this means it works on every platform that has ever reported on
buildfarm.

Maybe we can borrow some code.

cheers

andrew






pgsql-patches by date:

Previous
From: Chris Marcellino
Date:
Subject: Re: Feature: POSIX Shared memory support
Next
From: "Simon Riggs"
Date:
Subject: Fast CLUSTER