[DGD] Kernel library question
Blain
blain20 at gmail.com
Wed Aug 22 18:25:03 CEST 2018
Removing one callout of a given name at a time was the norm for LPMUD, et
al, so no biggie. ;)
What about an arbitrary handle number that is continually used even if the
callouts are suspended and resumed?
On Wed, Aug 22, 2018, 07:34 <bart at wotf.org> wrote:
> On Wed, 22 Aug 2018 04:19:18 -0700, Raymond Jennings wrote
> > Felix:
> >
> > Concerning how you originally designed the kernel library, what
> > happens if a callout goes off while callouts are suspended?
> >
> > Inspecting the source code, it would appear that the callout is
> > requeued at LONG_TIME
> >
> > But I noticed a potential oversight:
> >
> > 1. The handle of the requeued callout might change
> > 2. What happens if we try to remove_call_out(old_handle)?
> >
> > If a suspended callout's handle changes, should the "real" handle be
> > hidden from higher layers?
>
> While I cannot answer what Felix' intention was, this is the exact
> solution I
> implemented in the wotf kernel to handle this situation.
>
> The wotf kernel 'emulates' the classic lpmud find/remove_callout functions,
> which do not return a handle, but simply a 'time left', and use status()
> to do
> a lookup of call_outs by name. The disadvantage is obviously that you can
> only
> find/remove the first call_out with a given name (and have to rinse and
> repeat
> to remove all with a given name), but that is also a consequence of a
> desire
> to be compatible with a pre-existing api, this could be implemented
> differently so it returns an array with call_outs and lets you specify
> which
> instance you want to remove (which would be subject to race conditions
> unless
> the find and remove are done in the same 'thread'.
>
> Bart.
> --
> https://www.bartsplace.net/
> https://wotf.org/
> https://www.flickr.com/photos/mrobjective/
>
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
More information about the DGD
mailing list