[lkml]   [2002]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Dynamic Timer
"X.Xiao" wrote:
> I have two questions about dynamic timer in Linux:
> 1. Kernel space: After add_timer is used, where is the
> code used to poll the global 'struct timer_list' to
> activate the related functions on time? It's not in
> sched.c, is it in tasklet/bh?

The "code" is in timer.c (same place you found "add_timer())
and is called run_timer_list(). It is called by timer_bh()
also in timer.c, which is scheduled by do_timer() (also in
timer.c) which is called each timer interrupt by code in the
arch/kernel/ area (in i386 it is time.c) which, in turn is
called by the interrupt code.

> 2. User space: is there a way to set a dynamic timer
> in userspace as well, such as create_timer(posix, not
> in Linux)?

The tried and true way is the setitimer() call. The POSIX
calls are also available as a patch from the high-res-timers
project (see signature).

George Anzinger
Real time sched:
Preemption patch:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:22    [W:0.046 / U:1.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site