[DGD] Revisited: callout cantrip

Shentino shentino at gmail.com
Mon Jun 1 20:58:20 CEST 2009


Depends.

My two cents:

Since the callout isn't scheduled until the creating thread commits, in the
same thread there is no problem since a single ER is atomic by itself in the
sense that it either commits completely or not at all.

Schroedinger's cat style rescheduling will almost certainly prevent problems
later if one thread attempts to read data that another is trying to write.
The write will trigger a redo of the reading thread when it tries to commit
and discovers it read data that became stale.  IIRC of course.

As it is, the order of execution for callouts with identical expiry is
already undefined.

On Mon, Jun 1, 2009 at 11:49 AM, Dread Quixadhal <quixadhal at chartermi.net>wrote:

> Sounds clever, although I see danger with zero-length callouts and DGDMP,
> since without making the section between creating the call_out and
> modifying
> the arguments atomic (or some other semaphore-type locking), there's
> nothing
> to prevent processor #2 from picking it up and running with it before you
> actually do the change, no?
>
> On Mon, Jun 1, 2009 at 7:12 AM, <bart at wotf.org> wrote:
>
> > For those curious about this trick, Gurbalib svn revision 271 now uses
> this
> > call_out 'cantrip' idea in its event daemon. In /daemons/event_d.c in the
> > dispatch_event() function, you'll see that the counters are passed to a
> > call_out as an array, and then modified after the call_out has been
> > started.
> >
> > Bart.
> >
> > On Sat, 14 Mar 2009 02:16:49 -0700, Shentino wrote
> > > Ok, so I was sitting back for a bit, experimenting with callouts,
> > >  and I suddenly had the bright idea of trying to pass a callout its
> > > callout handle as an argument.
> > >
> > > Naturally, owing to causality, not very straightforward.
> > >
> > > Apparently arguments on pending callouts share the object's
> > > dataspace, so what I was able to do was pass a one element array,
> > >  have the callout scheduled, and then modify the array in place ala
> > > TLS/call_trace, thus giving the callout information on what its
> > > handle was. ___________________________________________
> > https://mail.dworkin.nl/mailman/listinfo/dgd
> >
> >
> > --
> > Created with Open WebMail at http://www.bartsplace.net/
> > Read my weblog at http://soapbox.bartsplace.net/
> >
> > ___________________________________________
> > https://mail.dworkin.nl/mailman/listinfo/dgd
> >
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
>



More information about the DGD mailing list