[DGD] Callout hack

Felix A. Croes felix at dworkin.nl
Thu Aug 31 21:42:34 CEST 2006


Shentino <shentino at gmail.com> wrote:

> Speaking of callouts...I'm trying to hack DGD so that millisecond
> callouts can have durations of longer than 60.0 seconds.
>
> I've noticed that the millisecond encoding is as follows:
>
> 8 bits (value 1) that say it's a millisecond callout
> 8 bits for the seconds,
> and 16 bits for the milliseconds.
>
> Would I be in for a major overhaul if I rearranged the bits as follows:
> 2 bits for the callout type
> 20 bits for the seconds
> 10 bits (1024 > 1000) for the milliseconds

That wouldn't work because the entire 32 bits of the callout delay value
can also be a time, in seconds since 1970, at which to start a callout.

The time as I write this is 0x44f73943 since 1970, so you could encode
milliseconds as follows: if the upper byte >= 0x40, the time value is
in seconds.  Otherwise, it is 0x20000000 + 19 bits for the seconds +
10 bits for the milliseconds.

I would just create a time server in LPC which can recover from time
loss due to dump/restore, though.

Regards,
Dworkin



More information about the DGD mailing list