Re: regarding timeout/untimeout kernel functions

From: Peter Jeremy (PeterJeremy_at_optushome.com.au)
Date: 07/23/04

  • Next message: Jake Hamby: "Re: "Next Generation" kernel configuration?"
    Date: Sat, 24 Jul 2004 07:13:41 +1000
    To: pradeep reddy punnam <prady_p@yahoo.com>
    
    

    [Please wrap your mail before 80 columns]

    On Thu, 2004-Jul-22 17:59:40 -0700, pradeep reddy punnam wrote:
    > i am working on a project , where i came across a
    >situation where i need to execute a function when a timer expires
    >,exactly similar to functionality of the timeout() kernel function

    How about setitimer(2) and a SIGALRM handler?

    >but i need this in userland(application), and the execution of the
    >function is time sensitive, it should be run immediately when timer
    >expires.

    What is your definition of "immediately"? Timeouts are rounded to
    ticks (and FreeBSD has a 1-2 tick slop for various reasons). Once the
    (rounded) timeout expires, then it's up to the scheduler to actually
    invoke your timer handler function in line with normal scheduling
    rules. Overall, it's unlikely that your handler will get called early
    but it will typically be called about 1 tick late (and there's no
    upper bound on how late your handler will be invoked if the system is
    heavily loaded).

    -- 
    Peter Jeremy
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: Jake Hamby: "Re: "Next Generation" kernel configuration?"

    Relevant Pages

    • Re: Serialport termios & timeout
      ... for VTIME and VMIN I can do it, ... If VTIME and VMIN are both greater than 0 the timer is ... and will timeout if there is the ...
      (comp.os.linux.development.apps)
    • Re: New "timeout" api, to replace callout
      ... existing timer, that means it wasn't close to firing and is moved ... session it has to be deallocated including stopping of all currently ... only ever grab the specified lock when it calls the timeout function. ... timeout data structures. ...
      (freebsd-arch)
    • Re: [patch 00/43] ktimer reworked
      ... >>> don't turn off the timer and take the cookies out before they are done. ... >> as in a timeout is expected to time out:) and a timer is expect to happen, ... a timeout let you know that it probably didn't make it (or the ACK ...
      (Linux-Kernel)
    • Re: Cant enable a Timer in a Speech Recognized handler
      ... is set up with an interval and event handler: ... if I try to launch a timer inside the 'recognized speech' handler ... I tried moving this to the Recognition Completed handler of the speech ... But that handler won't launch a timer either. ...
      (microsoft.public.dotnet.languages.vc)
    • runqueue locks in schedule()
      ... timers as the interface to allow timeout-based event set multiplexing. ... timeout measures virtual ... to reinstall the timer. ... On all architectures, but IA-64, it seems thet the runqueue lock is ...
      (Linux-Kernel)