Threads leaving zombie processes in windows

Wait! This sounds familiar.
  I am running the enclosed test program to determine whether my process is
a second instance on this workstation. As always, the C++ documentation
leaves more than a little to question -- so this test is the simplest form I
could try.

Environment: Python 2.3 (#46, Jul 29 2003).
      Windows2000 w/lots of recent updates.
      WxPython 2.4.2.4
      PythonWin Win23all build 157

Steps to invoke first error:
  1) Run the enclosed program by double-clicking the icon.
     (The Stdout window says: "no other is running", as expected.)
  2) Leaving both windows open, double-click the icon again.
     (The Stdout window again says: "no other is running" -- which is
incorrect.)
The problem here is probably me calling it wrong...
Your comments/corrections are appreciated.

Steps to invoke second error:
  1) Open the enclosed progam in the PythonWin editor and run it by clicking
the "running man" icon. (same results as before.)
  2) Leaving both windows open, click the "running man" icon again. (Same
incorrect results again.)
  3) Close the PythonWin editor window.
  4) Attempt to open a .py file using the PythonWin editor.
  4) Close all of the test program windows.
  A zombie process is left running in windows! Additional attempts to open
.py programs using the PythonWin editor will fail until one goes into
Windows Task Manager and kills the process "PythonWin.exe".

Is there a relationship between Ronald Jaramillo's problem and my second
error?
To whom should this (second) error report go, if not here?

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Tuesday, January 20, 2004 8:05 PM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] Threads leaving zombie processes in
windows

Ronald Jaramillo wrote:

Hi,
I have an application where the main frame start's a http server in a
thread. The frame then use an wxIEHTML window to display the content
from the server. So far so good.
The problem is that when I close my application (main.pyw) the http
server is stil running ( There is an instance of pythonw in the task
manager ). How can I terminate the threads that my app starts?

Send some kind of message to the thread that tells it to exit, and then
call it's join method to wait for it to do so. Or set it as a deamon
thread and then the process will be allowed to exit even if the thread
is still running. See the Python docs on the threading module.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org