[DGD] Kernel library question

bart at wotf.org bart at wotf.org
Wed Aug 22 18:45:08 CEST 2018


On Wed, 22 Aug 2018 11:25:03 -0500, Blain wrote
> Removing one callout of a given name at a time was the norm for 
> LPMUD, et al, so no biggie. ;)
> 

For way of the force that is a fesorable.aspect of that approach.

> What about an arbitrary handle number that is continually used even 
> if the callouts are suspended and resumed?
> 

Virtualizing the handles seems a good, even better solution for more dgd style
libs like the kernel library as that won't change the api.

Bart
> 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
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd


--
https://www.bartsplace.net/
https://wotf.org/
https://www.flickr.com/photos/mrobjective/




More information about the DGD mailing list