[e-lang] Proposal: Remove parameters
from __whenMoreResolved/__whenBroken reactors
Mark S. Miller
markm at cs.jhu.edu
Fri Feb 24 20:28:26 EST 2006
Kevin Reid wrote:
> I haven't noticed an explanation being posted, and I have not stumbled
> across the reason myself. Could you write it or point to where it was
> posted?
The DelayedRedirector and the Redirector use the reactor argument to propagate
promise resolution from the head of a remote reference to the tail. This same
mechanism is used to propagate partial resolution, shortening multivat promise
chains.
For example, let's say Xb is a remote promise in VatB for a local promise Xa
whose promise/resolver pair is on VatA, and Ya is a remote promise in VatA for
a local promise Yc on VatC. If VatA resolves Xa to Ya, this notifies the
DelayedRedirector for Xb with a new Yb as the argument. (This Yb is made by
during unserialization of the reactor notification message.) The
DelayedRedirector uses this argument to shorten Xb to be equivalent to Yb,
cutting VatA out of the promise chain. If nothing else is retaining the
portion of this promise chain in VatA, it can will be gc'ed.
When I tried to simplify the __whenMoreResolved protocol to remove the reactor
argument, I found I had no other means to shorten promise chains, or even to
resolve a remote promise when its target promise resolved.
--
Text by me above is hereby placed in the public domain
Cheers,
--MarkM
More information about the e-lang
mailing list