Windows, CreateThread

Gary Herron gherron at islandtraining.com
Mon Sep 7 19:15:28 EDT 2009


Torsten Mohr wrote:
> Hi,
>
> in a python C module i may need to create a Thread to do some background 
> observations / calculations.
>
> Are there any problems with Python doing something like this?
>
> Is there some special support on sharing data?
>
> I guess i can't call any Python functions from the thread, correct?
>
>
> Thanks for any hints,
> Torsten.
>
>
>   

Python has lots of support for threads.  Look at the *thread* and 
*threading* modules for (respectively) low and high level access to 
threads, and look at the *queue *module for passing data safely between 
threads.    While there are many issues and potential traps when thread 
programming.  you *can* call any function from any thread at any time 
with any data-- threads would be a waste if that were not so.

For an alternative to thread programming, you may be able to use the 
functionality of the *asynchat* and *asyncore* modules.

Gary Herron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090907/4601760d/attachment.html>


More information about the Python-list mailing list