(Win32 API) callback to Python, threading hiccups

Christopher Subich spam.csubich+block at block.subich.spam.com
Tue Jul 5 15:21:49 EDT 2005


Francois De Serres wrote:
> - so, on callback, I create a new thread, after checking that the 
> previous one has returned already (WaitOnSingleObject(mythread)) so we 
> only have one thread involved.

Uh... to me, this looks like a frighteningly inefficient way of doing 
things.  How about using a synchronous queue to post the data to a 
processing thread?  That way, you don't have to create an entierly new 
thread each time you receive data in the callback.



More information about the Python-list mailing list