Re: file-locking and postmaster.pid

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: korry <korry(at)appx(dot)com>
Cc: Andreas Joseph Krogh <andreak(at)officenet(dot)no>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: file-locking and postmaster.pid
Date: 2006-05-24 20:06:36
Message-ID: 20060524200636.GG5028@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

korry wrote:

> The only platform (although certainly not a minor issue) that I can
> think of that would have a portability issue would be Win32. You can't
> even read a locked byte in Win32. I usually solve that problem by
> locking a byte past the end of the file (which is portable).

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.

The Win32 API for locking seems mighty strange to me.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-05-24 20:07:53 Re: Improving ALTER TYPE support
Previous Message korry 2006-05-24 20:01:43 Re: file-locking and postmaster.pid