On Sep 2, 2005, at 8:41 , Andi Vajda wrote:

This reminded me to look at multithreaded debugging in Komodo (I'm running the Mac OS alpha). It turns out that setting breakpoints in an ordinary python thread works just fine. However, if you use a PyLucene thread (as Chandler does), breakpoints do not work. Anyone have an idea as to why?


The PyLucene.PythonThread class is a subclass of threading.Thread that delegates to libgcj the creation and starting of the OS thread. This is because libgcj's garbage collector does not support adding threads to the java environment after they have been created and started, the java.lang.Thread class must be used instead. There are then in fact two thread objects, one python, one java that correspond to one OS thread. I don't know what assumptions the debuggers are making about python threads but a PyLucene.PythonThread instance looks the same to python's threading module and python treats it as one of its own.

Ah, thanks for the explanation.

By the looks of things, Komodo installs its own stuff by patching thread.start_new_thread, which won't work in this case. I might take
a whack at patching their patch ;).

--Grant

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to