[PyKDE] *very* strange thread error when calling python objects from within C

Patrick Stinson ajole-1 at gci.net
Sun Feb 8 10:21:00 GMT 2004


Actually, I'm not sure what the error really is related to, but I'll try to 
explain it. I have a C++ library that stores 'Module' objects internally. 
background thread loops forever and calls 'Produce()' and 'Consume()' in that 
order on the module objects. The problem is that only recently, that 
background thread seems to lock itself *and* the parent thread when it calls 
a Produce() or Consume() on an object that was created in python. Execution 
never enters the method in question, and the parent thread never returns from 
a 'time.sleep(2)' python call (which is really freaking me out, btw).
Everything works fine if the module object is created from within the C++ 
code, or if that calling loop is executed from the main thread. I've tried 
starting the thread from python (using 'thread.start_new_thread()'), and from 
the C++ library, using pthreads directly. My C++ 'Module' class declares 
Consume() and Produce as public and virtual void, the subclass defines them 
as public and void, and the respective definitions in the sip files reflect 
this exactly (had problems with that stuff before, very frustrating).
Sorry that was so long, but I think this problem will require thourough 
explanation.

If needed I can post a code snapshot of my project on my site. It might be 
needed.

Cheers in advance!




More information about the PyQt mailing list