Re: Is there a problem in timeval_to_jiffies?

From: Henry Margies (henry.margies_at_gmx.de)
Date: 09/16/04

  • Next message: Vojtech Pavlik: "Re: device driver for the SGI system clock, mmtimer"
    Date:	Thu, 16 Sep 2004 20:10:21 +0200
    To: linux-kernel@vger.kernel.org
    
    

    Hi,

    On Thu, 16 Sep 2004 02:54:39 -0700
    George Anzinger <george@mvista.com> wrote:

    > Timers are constrained by the standard to NEVER finish early.

    I just thought about that again and I think you are wrong.
    Maybe your statement is true for one-shot timers, but not for
    interval timers.

    No interval timer can guarantee, that the time between to
    triggers is always greater or equal to the time you programmed
    it.

    1 occurrence of a 1000ms timer,
    10 occurrences of a 100ms timer and
    100 occurrences of a 10ms timer should take the same time.

    For example:

    I want to have an interval timer for each second. Because of
    some special reason the time between two triggers became 1.2
    seconds.
    The question is now, when do you want to have the next timer?

    Your approach would trigger the timer in at least one second. But
    that is not the behaviour of an interval timer. An interval timer
    should trigger in 0.8 seconds because I wanted him to trigger
    _every_ second.
    If you want to have at least one second between your timers, you
    have to use one-shot timers and restart them after each
    occurrence.

    And in fact, I think that no userspace program can ever take
    advantage of your approach, because it can be interrupted
    everytime, so there is no guarantee at all, that there will be at
    least some fixed time between the very important commands. (for
    interval timers)

    So, what about adding this rounding value just to it_value to
    guarantee that the first occurrence is in it least this time?

    Best regards,

    Henry

    -- 
    Hi! I'm a .signature virus! Copy me into your
    ~/.signature to help me spread!
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Vojtech Pavlik: "Re: device driver for the SGI system clock, mmtimer"

    Relevant Pages

    • Re: Interval timers on Fedora
      ... Would starting more than one interval timer in a single process confuse the signal system when delivering the SIGALRM to the receiving process? ... In other words, can I have a 10 second interval timer which when times out delivers a sigalrm to one function, and in the same process have a 1 second interval timer set to give a sigalrm to another function? ...
      (Fedora)
    • Re: Interval timers on Fedora
      ... Would starting more than one interval timer in a single process confuse the signal system when delivering the SIGALRM to the receiving process? ... In other words, can I have a 10 second interval timer which when times out delivers a sigalrm to one function, and in the same process have a 1 second interval timer set to give a sigalrm to another function? ...
      (Fedora)
    • Re: Is there a problem in timeval_to_jiffies?
      ... >>Timers are constrained by the standard to NEVER finish early. ... that a given timer signal can be delayed while the next signal ... The timer resolution is a function of what the hardware can ... > I want to have an interval timer for each second. ...
      (Linux-Kernel)
    • Re: helpppppppppppppppppppppppp!for design timer
      ... >> resistance)then point two disconect and point three is connect ... > circuit does not look well. ... The moment the first timer has been triggered ... > always trigger the next one on the falling edge of its predecessor. ...
      (sci.electronics.basics)
    • Re: hardware triggerable one-shot with 80c167
      ... Set the timer to zero, waiting to count to 1 when the trigger event occurs ... In the ISR triggered by the compare event, set a new compare event to the ... It'd take a bit more thought if you needed the pulse to be re-triggerable. ...
      (comp.arch.embedded)