gherron at islandtraining.com
Tue Sep 8 01:15:28 CEST 2009
Torsten Mohr wrote:
> 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,
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list