* Tom Lane <[EMAIL PROTECTED]> [010306 10:35] wrote:
> Alfred Perlstein <[EMAIL PROTECTED]> writes:
>
> > What about encoding the shm id in the pidfile? Then one can just ask
> > how many processes are attached to that segment? (if it doesn't
> > exist, one can assume all backends have exited)
>
> Hmm ... that might actually be a pretty good idea. A small problem is
> that the shm key isn't yet selected at the time we initially create the
> lockfile, but I can't think of any reason that we could not go back and
> append the key to the lockfile afterwards.
>
> > you want the field 'shm_nattch'
>
> Are there any portability problems with relying on shm_nattch to be
> available? If not, I like this a lot...
Well it's available on FreeBSD and Solaris, I'm sure Redhat has
some deamon that resets the value to 0 periodically just for kicks
so it might not be viable... :)
Seriously, there's some dispute on the type that 'shm_nattch' is,
under Solaris it's "shmatt_t" (unsigned long afaik), under FreeBSD
it's 'short' (i should fix this. :)).
But since you're really only testing for 0'ness then it shouldn't
really be a problem.
--
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Lamar Owen
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Tom Lane
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Lamar Owen
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Tom Lane
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Lamar Owen
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... dom
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Alfred Perlstein
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Tom Lane
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Alfred Perlstein
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Tom Lane
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Alfred Perlstein
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Tom Lane
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Alfred Perlstein
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Tom Lane
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Alfred Perlstein
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Cyril VELTER
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Alfred Perlstein
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Peter Eisentraut
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Lamar Owen
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Alfred Perlstein
- Re: [HACKERS] How to shoot yourself in the foot: kill -9 ... Tom Lane
