[Tinyos-devel] Bug in timer system
Michiel Konstapel
m.konstapel at sownet.nl
Wed Mar 5 01:08:21 PST 2008
> Timer1.startOneShot(200);
> Timer0.startOneShot(201);
>
> if Timer0 is instantiated with id 0 and Timer1 is instantiated with id
> 1 as the result of a call to unique(), then its possible that
> Timer0.fired() may be signaled before Timer1.fired() is signaled if
> there is a delay in processing the Timer task below the virtualizer
> code. In 99% of the cases this isn't important, but if code is
> written that relies on Timer1 firing before Time0, this may be an
> issue.
I'm probably too paranoid to rely on it, but assuming starting a timer takes less than a millisecond, I guess I would expect Timer1 to fire first in this case. Still, maybe Timer1 was started just before a tick of the underlying clock and Timer0 right after... I think I'd separate them by another millisecond to be on the safe side.
Michiel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20080305/a8bc86e4/attachment.htm
More information about the Tinyos-devel
mailing list