Re: alarm() - what am I doing wrong???



On Mon, 22 May 2006 09:44:37 +0000, Jan Panteltje wrote:

Cannot you use alarm_isr() to increment a variable each second,
and set a flag for main if it reaches 5?

Then have main set a flag that resets the counter in alarm_isr()
before it reaches 5 if data comes in?

Then when mai nsees the flag that 5 is reached (in your main loop),
it should do something.
?

If I'm using alarm() to count seconds, then the read() would only
be able to check for incoming data every second, no? I think I'd
lose a lot of data that way.
.



Relevant Pages

  • Re: alarm() - what am I doing wrong???
    ... Then have main set a flag that resets the counter in alarm_isr ... You read loop or select, or whatever, would run continously. ... There are some housekeeping activities which need to be ...
    (comp.os.linux.development.apps)
  • Re: alarm() - what am I doing wrong???
    ... Then have main set a flag that resets the counter in alarm_isr ... You read loop or select, or whatever, would run continously. ... retrigger *itself*. ...
    (comp.os.linux.development.apps)
  • df -kP != df -Pk
    ... It seems that -P flag to df resets previously specified -k for no good ... reason. ... Andriy Gapon ...
    (freebsd-stable)
  • [patch] rtc-sh: act on rtc_wkalrm.enabled when setting an alarm
    ... This fixes the SH rtc driver correctly act on the "enabled" flag when ... setting an alarm. ... Jamie Lenehan ...
    (Linux-Kernel)