[HACKERS] semaphore usage "port based"?

Vivek Khera vivek at khera.org
Mon Apr 3 18:22:25 UTC 2006


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.



More information about the freebsd-stable mailing list