Re: file-locking and postmaster.pid - Mailing list pgsql-hackers

From Tom Lane
Subject Re: file-locking and postmaster.pid
Date
Msg-id 1623.1148502887@sss.pgh.pa.us
Whole thread Raw
In response to Re: file-locking and postmaster.pid  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: file-locking and postmaster.pid
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Certainly on all platforms there must be *some* locking primitive.  We
> just need to figure out the appropiate parameters to fcntl() or flock()
> or lockf() on each.

Quite aside from the hassle factor of needing to deal with N variants of
the syscalls, I'm not convinced that it's guaranteed to work.  ISTR that
for instance NFS file locking is pretty much Alice-in-Wonderland :-(

Since the entire point here is to have a guaranteed bulletproof check,
locks that work most of the time on most platforms/filesystems aren't
gonna be an improvement.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: file-locking and postmaster.pid
Next
From: Josh Berkus
Date:
Subject: Re: Improving ALTER TYPE support