Multiple timers, one script, or multiple timer scripts?
sl42 at kryslix.com
Tue Jan 29 05:44:07 PST 2008
You have it right, Argent. Normally I would suggest optimizing it
further as a delta queue (yes, it really has a name, folks), but I
assume you are concerned about loss due to the inherit non-temporal
determinism of LSL scripts. It is possible to easily account for that
as well, though I am not sure about code size, etc, as I have not
coded it in LSL.
After all, on most hardware, and even more OSes, there is only a
single timer for the entire system. If you need any type of fine
granularity then a delta queue is the answer.
On Jan 29, 2008, at 6:56 AM, Argent Stonecutter wrote:
>> Ayah. I use the nasty flag kludge within the timer event to handle
>> multiple events.
> This isn't a kludge, it's a standard event list for turning a single
> timer into multiple timers. There's similar algorithms in every OS.
> What you're doing is a duty-cycle algorithm. If you have two timers
> running at different rates and only a single timer to implement them
> in, you run a timer at the greatest common factor and set up two
> counters to tell which event to run.
> Whether you use an event list or duty-cycle depends on the relative
> cost of empty timer events or resetting the timer, both in CPU time
> and potential timer drift.
> Click here to unsubscribe or manage your list subscription:
More information about the secondlifescripters