On Tue, 2012-10-30 at 18:52 +0100, Cyrille Henry wrote:
hello,
if your problem is detecting when cpu is over 100% so that delay is not acurate, then the best solution is some kind of external watchdog.
just send a message every 10 ms to an other software, if this external software did not receive anything during the last 20ms, then there is a cpu problem on the pd side...
the external software can be an other pd, a shell script (using pdreceive, or anything else.
An external watchdog will only help in detecting a timeout, but it won't help prevent it. There probably is no way to stop Pd from doing what it is currently doing as it will always first finish its current task before it considers the next ( triggered by message from network, from HID, etc.).
Jean-Adrien, I think you would have to design your patch in a way that makes sure that no single task takes more than 250ms. If this is possible at all depends on what your tasks look like. If tasks take too much time, split them in smaller task. If every single task takes only a fraction of the allowed timeout, you could ask [realtime] about how long the last task took and decide whether you need to respond now or if it is safe to execute another task.
Roman