Problems with threading and python extensions

Kyle Harrigan kwharrigan at yahoo.com
Mon Jul 12 14:57:43 EDT 2004


My problem is somewhat complex.  I have a Python extension written in
VC++ 6.0 that is used to access the Java API of a third party program
I must use.  I use this python extension in a particular script to
access the functionality contained within this Java program.  This
script, when running on its own, will execute a particular message
creation function fine, and is able to execute the function multiple
times.  However, when the script is run as a thread, the message
creation function will only execute correctly the first time, and will
fail on subsequent calls (somewhere within the Java program that I
have no access to).  After some time, I get:

*** panic: GC failed to enter single threaded mode (possibly
undetached threads?
), error code = -1

Which is actually able to crash the python thread and subsequently
Python itself.  I have identified the line which causes the crash in
my C++ source and attempted to place it in a critical section (giving
it the python global thread lock), thinking perhaps Java could not GC
because it wasn't the active thread.  Any help would be appreciated. 
Feel free to write for clarification on this problem, I realize the
description is somewhat fuzzy.



More information about the Python-list mailing list