help with threads

Loïc Domaigné loic.domaigne at googlemail.com
Fri Aug 7 00:04:40 EDT 2009


Hallo Michael,

> I have a simple application that needs one thread to manage networking
> in addition to the main "thread" that does the main job. It's not
> working right. I know hardly anything about threads, so I was hoping
> someone could point me in the right direction to research this.
>
> Basically, I have a program that does some computational work, and
> also conveys its status to a monitor program elsewhere on the network
> via sockets. I wanted to use a thread to manage the networking so that
> the main program can run without regard to networking (i.e. they would
> be asynchronous). So the network thread loops and calls select.
>
> My problem is that in some cases, the network thread appears to stop,
> while the main thread is doing a long computation.
>
> I'm hoping someone can give me a general idea what to read about. For
> example, under what conditions does a thread stop running? Can other
> threads "take priority"? Are there certain operations that block other
> threads (such as disk access)?

May I suggest:
http://www.dabeaz.com/python/GIL.pdf

HTH,
Loïc
--
My Blog: http://www.domaigne.com/blog

"There is only one problem with common sense; it’s not very common."
-- Milt Bryce



More information about the Python-list mailing list