ualarm() Interrupts select()

From: William (wh2leung_at_student.cs.uwaterloo.ca)
Date: 03/27/05

  • Next message: Måns Rullgård: "Re: I cant seem to get nanosleep to work (beginner)"
    Date: Sun, 27 Mar 2005 11:58:46 -0500
    
    

    For the following code snippet:

    for ( ;; ) {
            numFDInSet = select( fdmax+1, &readfds, NULL, NULL, &tv );

            // ...

            signal( SIGALRM, alarm_handler );

            // ...

            ualarm( waitPeriod * 1000, 0 );
    }

    The problem being if the alarm goes off when select() is scanning the
    FD_SET, select is interruped with the following error:

    Error on select(): Interrupted system call

    Ideally, when the alarm goes off, I would still want select() to continue
    scanning the FD_SET and the "main loop" to continue ( select() is inside
    the main loop ). Any suggestions to achieving achieving this is
    appreicated.


  • Next message: Måns Rullgård: "Re: I cant seem to get nanosleep to work (beginner)"

    Relevant Pages

    • ualarm() Interrupting select()
      ... The problem being if the alarm goes off when selectis scanning the ... Ideally, when the alarm goes off, I would still want selectto continue ... the main loop). ... Any suggestions to achieving achieving this is ...
      (comp.lang.cpp)
    • Re: ALRM weirdness in Perl 5.8.0
      ... Purl Gurl wrote: ... I demonstrated wrapping ALARM inside ... any looping mechanism, which includes a while loop, a for loop ... Second thought is to pull your ALARM assignment outside ...
      (comp.lang.perl.misc)
    • Re: Beginner question on resistance
      ... condition) or open (alarm condition). ... The limit depends on how much current the alarm passes through the contacts (and the resistance of their wiring) and at what total voltage drop across that circuit, it decides that some switch is open. ... For instance, if the switch loop is fed with 10 mA and decides that an open condition is indicated at a voltage drop of 2 volts, then the total resistance of the loop and all the switch contacts must drop less than 2 volts while 10 mA passes through them. ... For any reasonable gauge wire, that is a lot of length, but this example is completely hypothetical. ...
      (sci.electronics.basics)
    • Re: Sound recognition (not voice) - recording instances and duration of
      ... continuous loop. ... This alarm is located about 30 feet ... how long the alarm sound is operating. ... it would be sort of like a motion dector security system but being ...
      (comp.home.automation)
    • Re: False alarm due to temperature????
      ... out what the loop response time is on the control panel. ... Back in September lightning struck my self installed, wired alarm ... would have shown an open sensor until the temp rose. ...
      (alt.security.alarms)