lkml.org 
[lkml]   [1999]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Scheduling inside bottom-half
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/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.052 / U:13.216 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site