question to start_new_thread in thread

Thomas Schmid t.schmid at gmx.net
Fri Oct 3 03:14:59 EDT 2003


Peter Hansen <peter at engcorp.com> wrote in message news:<3F7C6992.69B05F18 at engcorp.com>...
> 
> I can't answer this other than to say stop using "thread" and start
> using "threading".  If you are using "threading" and your threads stop,
> they disappear as you would expect.  I don't think anyone is supposed 
> to use "thread" anymore...  and it might solve your problems.
> 
> -Peter

I tried it out and wrote instead of thread.start_new_thread this:
connThread = Thread(target=self.ConnctionHandler, args=(conn,))
connThread.start()
The result is exactly the same. First, I see only one process. But as
soon as I connect to the server, there are two processes which always
are there even if I disconnect. But still, there are never more then
two processes. I think the other process is a controle thread because
I found this in the documentation:
"There is a ``main thread'' object; this corresponds to the initial
thread of control in the Python program. It is not a daemon thread."

bye

Thomas




More information about the Python-list mailing list