Currently, the Linux port of PD makes itself a POSIX real-time process, which means that if it goes into some infinite loop, you have to reboot your machine.
Once when working with Csound, I used a software watchdogging scheme that seemed to work, and I was wondering whether it might be appropriate to use it for PD.
It requires POSIX threads, but I think these have recently been folded into glibc so that everyone will have them (?)
It works like this:
The main program (in this case, PD), runs with POSIX real-time scheduling, but at a priority less then maximum.
It spawns a watchdog thread of lesser priority (probably SCHED_OTHER), that periodically sets a flag.
It also spawns a real-time task of higher priority than the main program, which periodically checks that this flag has been set, and then clears it. If it finds that an interval goes by without the flag being set by the watchdog task, it means that PD is stuck hogging the CPU, or is simply too slow for real-time, and then can terminate PD.
Should we do something like this for PD? Or is there already some fail-safe measure in place?
Larry
-- Larry Troxler -- lt@westnet.com -- Patterson, NY USA --