-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-10-30 18:13, Jean-Marie Adrien wrote:
Hello I'm trying to launch security procedures in case of trouble, that will respond in less than 250 msec. The fundamental question is :
Is there an object to schedule an event in the future with firm absolute delay ?
if you want "hard realtime", then you would need a system that is capable of doing realtime. no "standard" (as in "desktop") operating system on the market will fullfill your needs.
so let's assume "soft realtime" (where a given piece of code has 'hopefully' been executed by a certain time) is good enough.
you are facing to different problems:
also do your specific tasks. adding more CPUs might help if there are *other* programs involved that eat your processing power. it's not so easy if Pd itself is consming too much CPU: unfortunately Pd is inherently single threaded, so there is no way to start your "security procedures" if the main thread is busy having "troubles", short of running 2 Pd's in parallel (and let them communicate e.g. via network)
clock) of [delay] even if your CPU does not run at 100%. Pd's logical time is floating a bit (compared to real time) in order to be able to prevent dropouts due to short CPU load spikes. however (unless you really max out your CPU for longer periods) the elasticity is limited, and is basically a function of your "audiobuffer" settings in the media settings dialog. so try reducing the audiobuffer, or even run Pd without audio (depending on your needs) and tune the "-sleepgrain" parameter, to get a reasonably low jitter.
once you have done that, simply schedule your "security procedures" at "250-maxjitter" in the future, which should make your system react at most 250ms in the future, which seems to be what you have been asking for.
fgmasdr IOhannes