On Thu, Feb 16, 2006 at 11:25:17PM -0500, Matt Timmermans wrote:
It looks like the problem is a call in line 640-something in axis, in the update method. It tells something to call the same method again in 20ms and then does the update. If it takes more than 20ms to do the update, bad things ensue, including deadlocks on some semaphores. You might be able to replicate the problem by setting the delay to 1ms or so.
When I moved the enqueing call to the end of the update method, axis started to work just fine. I don't know whether or not even that is completely safe, however. Are "TkIntr" callbacks single-threaded?
I'm glad you could find a change that made axis work for you. Knowing the change you made, I hope I'll be able to understand the bug better. Tk (and Tkinter, which just a Python wrapper for Tk) is based on an event loop, not threads. Normally, an event scheduled with "after" will be handled only after the code currently running returns to the event loop, so it should be safe to schedule the next "after" at any time in the current invocation. There are several Tk commands that can cause events to be handled immediately ("update", "vwait", and "tkwait" come to mind), but I didn't believe any of them were called in the affected code. The reason the next 'after' was scheduled at the very top is this: If an error happens somewhere inside the callback this time, I wanted to be confident that there was a next invocation already scheduled. However, in practice there are not runtime exceptions in this code, and ther are other ways to ensure this (like using try/finally). I intend to fix this bug in the upcoming AXIS 1.2 alpha 3, but I don't know if paul_c has any plans to package newer versions of AXIS for bdi. If you want to build your own version of axis on bdi, you first have to build a version of emc. To build the same version that is installed by default, follow these directions: http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl/emcinfo.pl?BDI-4_Install (install extra development packages, then edit sources.list, then apt-get source emc, configure, and make), then follow the instructions for building axis here: http://axis.unpythonic.net/installing (those instructions refer to emc2 but should also work for the version of emc on bdi) If you have trouble building axis, please let me know, either directly or on this list. Thanks for your kind words about AXIS. Jeff