From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Getting delay of two events
Date: Sun, 31 Dec 2006 08:04:13 -0500
Date: 2006-12-31T08:04:13-05:00 [thread overview]
Message-ID: <u8xgokyia.fsf@stephe-leake.org> (raw)
In-Reply-To: 4t9i64-8ac.ln1@newserver.thecreems.com
Jeffrey Creem <jeff@thecreems.com> writes:
>> mark wrote:
>>
>>>Hello,
>>>
>>>I have an external library with a task and a function getSync which
>>>returns boolean value (true if it is in sync position, false
>>>otherwise). Now I would like to create another task which will get the
>>>time between two sync (i.e. moments of time when the get_sync function
>>>returns true). Any ideas how can I make it??
>
> The options I see are
>
> 1) Yuck - Create a task that is higher priority than the 'external
> library task' and have it poll at some fixed rate that you know is
> faster than the library task could possibly run (at least 2x faster
> but obviously even faster than that depending on what sort of
> resolution you were looking for on the timer).
>
> 2) Less Yucky - Modify the library task to call someone else at the
> start and stop. Tends to introduce artificial coupling and start the
> spider web of coupling that wrecks a nice SW design.
>
> 3)Still less - Add two new entry points to the library task that it
> accepts (with essentially a zero timeout) at the start and stop then
> rendevous with them from the new task - Again you will need to be sure
> that the new task is higher priority so that it can 'make it' to the
> second rendevous point before the library task hits the second accept.
> Downside of this approach is that it will only really work well for
> one external observer.
4) modify the library task to do the timing.
Since the library task knows when the events occur, it needs to do the
timing!
--
-- Stephe
prev parent reply other threads:[~2006-12-31 13:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-28 15:47 Getting delay of two events mark
2006-12-29 21:19 ` JPWoodruff
2006-12-30 14:33 ` Jeffrey Creem
2006-12-31 13:04 ` Stephen Leake [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox