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

Re: [ns] Correlating wall-clock time w/ NS time



On Sat, 4 Aug 2001, Florian-Daniel Otel wrote:

> So far the only work-around we could find was to profile the relevant
> pieces of code, cache the result, and then "post" a re-call in future
> e.g.
> 
> $ns at [expr $now + $interval] "Do my stuff _again_" 
> 
> This will be just a fake re-call that will actually return the result
> cached in the previous call path. Of course, there is a pre-defined
> overall behaviour when "computation is pending" (e.g. drop all
> incoming packets while computing the routing tables). 
> 
> 
> Needless to say this is a major PITA and has serious drawbacks
> i.e. you can use the same call path only once, code on all affected
> call paths must be butchered accordingly, etc. 

you can only use the same call path once? I don't get that; the
mystuffagain procedure can end with a callback to pick up information
on when to schedule a new future event.

And, before you first post a recall, you can start a faster
'heartbeat' prcess that runs at constant intervals stuffing the
information on future aynchronous event executation times into some
array or other for the callback in the mystuffagain procedure to pick
up on to schedule the next mystuffagain, or start a new mystuffagain
going (or cancel and reschedule to the earlier time after putting
later time after it in database) if the time is before the next
occurrence of mystuffagain.

The key here is that each event schedules its next occurrence, and
that's essentially asynchronous - what am I missing?

L.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>