[Tinyos-devel] improving FTSP interface

Omprakash Gnawali gnawali at usc.edu
Fri Aug 8 10:05:48 PDT 2008


On Fri, Aug 8, 2008 at 12:11 AM, Miklos Maroti <mmaroti at math.u-szeged.hu> wrote:
>> One other topic when we are trying to improve FTSP interface - Let's
>> say, FTSP says the current time is 5 and later it says the current
>> time is 10, do I know if 5 units of time have elapsed? We probably
>> want another bit to tell if there was any desync/sync event since the
>> last read.
>
> Do you assume that your component is the only user of FTSP? If not,
> then you need a parameterized interface to support this! Would not it

Right, we should not assume that only one component is allowed to read the time.

> be enough if your component maintains the last read global time, and
> if the new global time is smaller than the last one (can be detected
> with the "(int32_t)(new_global_time - last_global_time) < 0" which
> takes into account the wraparound) then you had a decrese. You can
> also achieve this with the overflow bit.

Even if the current time is larger than the previous time, we can not
preclude wraparound unless we put constraints on the minimum frequency
at which an application must read the time.

Even if the current time is larger than the previous time by t units,
we can not be certain that t units of have have elapsed because it is
possible that we are now following the time of a new leader and t +/-
delta with the new leader has elapsed. In this case, it would be good
to know that we changed the leader since the last read so the time
reading should not be compared with the last read time.

>> This is a nice lead into the push vs pull discussion. If there are a
>> few bits like these that need to be read for each time reading then it
>> probably makes sense to make it push.
>
> Push is better because then you do not need to maintain state!
>

For pull to work, FTSP will need to maintain some state per reader.
The reader might have to maintain some state too (previous time,
previous leader).

- om_p


More information about the Tinyos-devel mailing list