Am 05.09.2007 um 22:04 schrieb Claude Heiland-Allen:
Yes, I remember, with different return codes from the hook for "I'm done" and "I have more to do" (and also "I did nothing"?).
I also think there should be a better mechanism for registering hooks, that also allows unregistering hooks later. Example:
1. X stores existing loader hook W, registers hook X
2. Y stores existing loader hook X, registers hook Y
3. X wants to remove hook, so restores loader hook to W
4. Y no longer has its hook registered => badness
In Miller's pd the sys_idlehook is meant to be modified primarily on class setup - unregistering is not possible as you outlined. In the devel branch, there's a threadsafe sys_callback function to do this.
Return value 0 (i'm done) for a registered idle callback function would unregister the hook.
Have a look at our paper on your pdconf usb stick.
Something like a priority queue of hooks would be useful, but then you're in the realm of implementing a multitasking scheduler....
It's not undoable but then again it might be more useful to use separate threads with adjustable priorities and use fifo queues and idle processing for communication with the pd kernel. That's how it is done in vibrez.
greetings, Thomas