[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Timed routines



VALETTE Eric wrote:
> 
> >>>>> "Joel" == Joel Sherrill <joel.sherrill at oarcorp.com> writes:
> 
> Joel> Is it possible to support both?  All (I think) it would take is either
> Joel> (1) a
> Joel> new timer manager routine to create a "task level" TSR or (2) a
> Joel> modification
> Joel> to the API of the current timer_create to add an attribute that
> Joel> specifies
> Joel> task level or clock tick level.
> 
> Do not reinvent the wheel. <http://cseng.aw.com/bookdetail.qry?ISBN=0-201-63392-2&ptype=1482>
> or POSIX has already provision for that...

My impression is that there are multiple implementations of an alarm
based on various 
POSIX concurrency mechanisms.  Any one in particular you are thinking
of?

It also looks like the code would need some recasting to be in library
form and I don't
see any documentation.  There is probably some in the book.  I can't
tell about the licensing
either.

FWIW I think all that is required to implement this is setting up two
server tasks 
(when and after) with a dedicated Watchdog chain per server.  Each tasks
waits
on a semaphore which is tickled at the appropriate time by a real TSR
handler.
The watchdog routines would then be the same.  There may be some
optimizations to be
made to keep the tasks asleep when there is nothing to do.


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985