[capi-sig] Threading failure

Dave Brotherstone davegb at pobox.com
Tue Jul 6 17:46:13 CEST 2010


On Mon, Jul 5, 2010 at 8:36 PM, Paul Grunau <paul at anilabsys.com> wrote:

> I asked this question here a few days ago, and someone suggested I ask
> again,
> providing all the code, so that it can be actually tried. So here it is,
> and I’m
> still stumped.
>
>
Although I've never written a pure extension, I have just implemented an
embedded & extended python, that works with multiple C threads, and I can't
see anything glaringly obviously wrong in your code.  What I might suggest
is that you try with the debug version of python, and then when the program
crashes you can take a dump, allowing you to see at least the stack trace
for the different threads.  Maybe that will provide some clues.  I found
that useful when debugging mine.

I'd also say that as you suggest that it only crashes when the timer ticks
very often, it could be a re-entrant problem?  The docs on timeSetEvent
don't give much information, but if the one timer callback event hasn't
finished by the time the next one starts, does that start a new thread, wait
for the last to finish then callback again on the same thread?


Hopefully someone with more experience can spot something.

Just a suggestion.

Dave.


More information about the capi-sig mailing list