Question about Reentrancy

Leigh Stoller stoller at fast.cs.utah.edu
Tue Mar 7 13:25:18 EST 2000


Hi. I was looking at the 1.01 source, and I have question regarding
timers. Actually, this may be more of a question about Linux than about
timers and reentrancy.

I notice that the driver runs as a linux kernel thread. It also appears to
me that in Linux, timer callbacks are invoked from the bottom half handler,
which is run at the end of IRQ handling. In lib/timer.cc:

	Timer::element_timer(unsigned long thunk)
	{
	  Element *f = (Element *)thunk;
	  // don't do anything - just put it on the work list
	  f->join_scheduler();
	#ifdef __KERNEL__
	#ifndef HAVE_POLLING
	  // run work list
	  f->router()->driver();
	#endif
	#endif

Is there a possibility that a Click timer will expire while the driver
thread is running, and that the callback will run on the return from the
clock interrupt? Would this result in a reentrancy into the driver loop?

Sorry if this is just a question resulting from not understanding how Linux
works, but I figure its a simple explantion for you folks.

Thanks!
Lbs

---------------------------------------------------------------------------
Leigh B. Stoller                     Computer Science - Flux Research Group
stoller at cs.utah.edu                  University of Utah
http://www.cs.utah.edu/~stoller      Salt Lake City, Utah 84112
Voice: (541) 929-2666                FAX: (801) 585-3743
---------------------------------------------------------------------------



More information about the click mailing list