http://qs321.pair.com?node_id=506161


in reply to Re: making something happen in real time
in thread making something happen in real time

Well, I could just spin in a tight loop instead of using select, but I'd like to avoid having my program be a cpu hog when it shouldn't have any need to be. I don't think sleeping for shorter intervals will help, because it just seems to require several hundred milliseconds to get the cpu back from xscreensaver, and that's a lot longer than the timing resolution I need.
  • Comment on Re^2: making something happen in real time

Replies are listed 'Best First'.
Re^3: making something happen in real time
by bageler (Hermit) on Nov 07, 2005 at 07:05 UTC
    Well, it sounds like that's what you should do to me. If there's a swinging blade (xscreensaver) and you want to dodge between it (beep) you have to have better time resolution than the period of the pendulum. Maybe you could increase the resolution only near the time when the screensaver should be kicking in? Then, for the majority of the time, you can be less of a cpu hog. That would still leave you vulnerable to anything else that might be going on in your system that also has a high resolution.