Re: Scheduling inside bottom-half

B. James Phillippe (bryan@terran.org)
Thu, 30 Sep 1999 14:12:13 -0700 (PDT)


On Thu, 30 Sep 1999, Linux Lists wrote:

> Where can I find more info about how to use kernel timers ??

Take a look at the struct timer_list in include/linux/timer.h (ignore the
"old" timers). Then look through a kernel driver which uses them and see
how they are used (a good example is drivers/net/tulip.c; grep for timer).
It works somewhat like a signal handler, in that you have a function
returning void that is run asynchronously when the signal is raised (in
this case, the timer expires). Instead of taking the signal as the
argument, the function will take a value you specify in the timer_list.
Just be mindful of how you allocate the struct and care for it; it is not
copied when queued, so accessing it/freeing it will break you. Also, the
timer runs at interrupt-time as well, so you can't sleep/etc there, either.

-bp

--
# bryan at terran dot org
# http://www.terran.org/~bryan

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/