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

From korry
Subject Re: file-locking and postmaster.pid
Date
Msg-id 1148500903.21335.51.camel@sakai.localdomain
Whole thread Raw
In response to Re: file-locking and postmaster.pid  (Andreas Joseph Krogh <andreak@officenet.no>)
Responses Re: file-locking and postmaster.pid
List pgsql-hackers
<blockquote type="CITE"><pre>
<font color="#000000">On Wednesday 24 May 2006 21:03, korry wrote:</font>
<font color="#000000">> > I'm sure there's a good reason for having it the way it is, having so</font>
<font color="#000000">> > many smart knowledgeable people working on this project. Could someone</font>
<font color="#000000">> > please explain the rationale of the current solution to me?</font>
<font color="#000000">></font>
<font color="#000000">> We've ignored Andreas' original question.  Why not use a lock to</font>
<font color="#000000">> indicate that the postmaster is still running?  At first blush, that</font>
<font color="#000000">> seems more reliable than checking for a (possibly recycled) process ID.</font>

<font color="#000000">As Tom replied: Portability.</font>
</pre></blockquote><br /> Thanks - I missed that part of Tom's message. <br /><br /><br /> The only platform (although
certainlynot a minor issue) that I can think of that would have a portability issue would be Win32. You can't even
<i>read</i>a locked byte in Win32.  I usually solve that problem by locking a byte past the end of the file (which is
portable).<br/><br /> Is there some other portability issue that I'm missing?<br /><br /><br />             -- Korry<br
/><br/><br /> 

pgsql-hackers by date:

Previous
From: korry
Date:
Subject: Re: file-locking and postmaster.pid
Next
From: Alvaro Herrera
Date:
Subject: Re: file-locking and postmaster.pid