[python-uk] Extending Python - Asynchronous Callbacks

Duncan Grisby duncan at grisby.org
Fri Aug 15 13:27:34 EDT 2003

On Friday 15 August, "Phil Hornby" wrote:

> Me and another guy have done some stuff with Asynchronos callbacks from
> another thread...took a bit of playing to get it to work...We had several
> instances of long uptimes but after, sometimes, 3 days you would have a
> clash...the joys of concurrency...

>     PyEval_RestoreThread(this->pPythonCBThreadState); // pretend that we're
> the callback python thread

That will break on debug versions of Python 2.3, since it asserts that
a thread state always lives with the same thread.

I wrote some code in omniORBpy that maintains a cache of thread states
for callbacks, and copes with Python 2.3's new GIL access functions.
You can see the code from SourceForge's CVS. Apologies for the
ridiculously long URLs...





 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --

More information about the python-uk mailing list