Re: Stats collection on Windows - Mailing list pgsql-hackers

From stephen joseph butler
Subject Re: Stats collection on Windows
Date
Msg-id f107df20604050742j1a158b2fh5f60d0427b9c3384@mail.gmail.com
Whole thread Raw
In response to Re: Stats collection on Windows  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
2006/4/5, Tom Lane <tgl@sss.pgh.pa.us>:
AFAICS, don't-reuse-PIDs-too-quick has exact analogs that Windows has
to solve by ensuring it doesn't reuse HANDLEs too quick.


There's a disconnect here. handles aren't process identifiers: they're reference counted "pointers" to the kernel structures for the process. If you are holding a handle (ie: from CreateProcess or OpenProcess) that handle cannot and will not be reclaimed until you call CloseHandle (or your process itself exits). You should never retain a handle after you've called CloseHandle on it.

Which brings an interesting thought: are process ID's reclaimed while open handles remain? I'm willing to bet the answer is no. In that case, the stats collector could retain the handle until it's done with the process ID.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Tru64/Alpha problems
Next
From: "Magnus Hagander"
Date:
Subject: Re: Stats collection on Windows