Re: Stats collection on Windows

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Stats collection on Windows
Дата
Msg-id 20060405073006.GA18401@svana.org
обсуждение исходный текст
Ответ на Re: Stats collection on Windows  (mark@mark.mielke.cc)
Ответы Re: Stats collection on Windows  (mark@mark.mielke.cc)
Список pgsql-hackers
On Wed, Apr 05, 2006 at 03:20:47AM -0400, mark@mark.mielke.cc wrote:
> TerminateProcess takes a HANDLE, not a process identifier. Yes, they
> provide the "kill" primitive, but only as a compatibility measure.  A
> "good" Windows process, should maintain a HANDLE to the process, and
> kill the process using the HANDLE. This way, there is no race.  The
> HANDLE is also how you wait for the process to terminate normally.

Which presents the solution, we should use the HANDLE on windows rather
than the process identifier.

> I prefer the "Redmond" way, in that I find UNIX's use of integer
> identifiers to be encouraging of race conditions. UNIX requires hacks
> like minimizing PID reuse, because UNIX is the one that is broken. :-)

Eh? A HANDLE is (or can be mapped to) an integer too. I don't see
anything on that page about handle reuse. If you run a machine long
enough I'm sure it can be reused also...

Have a nice day,

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: mark@mark.mielke.cc
Дата:
Сообщение: Re: Stats collection on Windows
Следующее
От: mark@mark.mielke.cc
Дата:
Сообщение: Re: Stats collection on Windows