Re: semaphore usage "port based"? - Mailing list pgsql-hackers

From Vivek Khera
Subject Re: semaphore usage "port based"?
Date
Msg-id A1072D0B-7416-493C-8CCC-C9126134A9B3@khera.org
Whole thread Raw
In response to Re: semaphore usage "port based"?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Apr 3, 2006, at 12:37 PM, Tom Lane wrote:

> semaphore keys on each cycle of life, so you'd have to get fooled by
> chance coincidence of existing PIDs every time over many cycles to
> have a severe resource-leakage problem.  (BTW, Marc, that's the reason
> for *not* randomizing the key selection as you suggested.)

Seems to me the way around this with minimal fuss is to add a flag to  
postgres to have it  start at different points in the ID sequence.   
So pg#1 would start at first position, pg#2 second ID position, etc.   
then just hard-code an "instance ID" into the startup script for each  
pg.  No randomization make it easier to debug, and unique IDs make it  
avoid clashes under normal cases.



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Feature list for SQL:2003
Next
From: Stephen Frost
Date:
Subject: Re: semaphore usage "port based"?