[e-lang] EProxyResolver and sameness-breaking
Kevin Reid
kpreid at mac.com
Wed Mar 7 10:40:02 CST 2007
The current protocol of EProxyResolver provides a number of ways to
break sameness by creating multiple proxies that don't behave the
same despite being ==. I would like to eliminate this, so that user
comm systems (and other uses for EProxyResolver) do not have this
unnecessary authority.
Here is an idea:
Remove the identity argument to makeEProxyResolver, and the resolve
and smash methods from the resolver.
Instead, makeEProxyResolver has an optional second argument (run/1
and run/2).
For run/1, the proxy is resolved.
For run/2, the proxy is a promise, and the second argument is a
promise which will resolve to the resolution of the proxy.
Either way, the proxy's identity is the same as that of all other
calls to makeEProxyResolver with the same arguments.
Since the handler is the same, two == proxies cannot respond
differently to messages, and since the resolution is specified by a
promise, two == proxies cannot resolve to different references.
Usage:
In the case of far refs, a comm system can maintain proper identities
by using a weak-value hash table to store handlers, or by using
Selfless handlers.
In the case of remote promises, a comm system must use a hash table
to store the promise-and-handler pairs. This is an additional cost
over the current system, and I haven't yet thought of a fix.
What do you think of this idea?
--
Kevin Reid <http://homepage.mac.com/kpreid/>
More information about the e-lang
mailing list