Subject: Re: USB device exploration
To: None <augustss@cs.chalmers.se>
From: Wolfgang Solfrank <ws@tools.de>
List: tech-kern
Date: 04/21/1998 14:07:34
> I guess this shows my ignorance, can a timeout
> routine do arbitrary kernel calls, e.g., tsleep()?
> If they can, then I guess it would be possible
> to set up such a timeout routine.

No, it cannot call tsleep.  It's just like an interrupt routine (actually
it is run (more or less) as a subroutine to the clock interrupt code),
so it cannot do anything to the current process.

It sounds as if you don't know the timeout mechanism:

You call timeout() with three parameters, the routine to call, an argument,
and the number of clock ticks (normally derived from the variable hz which
gives the number of clock ticks per second) to wait before calling this routine.

tsleep() on the other hand would block the current process until some event
happens or the timeout argument to tsleep runs out (which happens to be
of the same dimension as timeout()'s last parameter :-)).

>From what you've told so far, it sounds as if a call to timeout with a
last parameter of, say, hz would fit your needs.

Hope it helps.
-- 
ws@TooLs.DE     (Wolfgang Solfrank, TooLs GmbH) 	+49-228-985800