Post by Mark S. MillerI had not realized I had posed such a challenging situation. In mulling
over what needs to happen, I think the followOn message send (#hashCode)
needs to be a 3-vat situation, *of the Resolver*, to prevent GC. Here
are the steps I think are needed, #6 being the point where my system is
failing, due to its absence?
Hi Rob, I don't think I understand the scenario that's driving this. I
went back to the beginning of the thread and found
Hi Mark, I suppose it is best to just post the pertinent code. First is
public class GalaxyObject {
public int getTheAnswer() { return 42; }
public Ref redirectForTheAnswer(Ref ref) throws NotResolvedException {
return ref.redirectMessage("getTheAnswer"); }
}
Hi Mark, does this make sense? redirectForTheAnswer sends getTheAnswer to
the arg Ref and returns the promise. In the code below, the arg Ref is
Bob, a GalazyObject in a third Vat, so the return of redirectForTheAnswer
is a RemotePromise. THe follow on message below is #hashCode, is sent to
this RemotePromise.
Ref answer = alice.redirectMessage("redirectForTheAnswer",
bob).redirectMessage("hashCode");
Thanks Rob,
I am able to follow this. As I started going through your scenario below, I
started thinking "wait, I don't *think* that's right". I think of the
evolution of distributed CapTP state very much using pictures, and found
myself wanting to draw some. For this kind of thing I find slide-by-slide
"animations" to show the dynamics is good. In terms of the colors and
symbology of <http://erights.org/elib/distrib/captp/4tables.html>, would
you say that the first (and only at this moment) slide of <
https://docs.google.com/presentation/d/1VTMuCVZDPAI1f2aezDEeRUVFUygRroiZcJG6ECKp8Nw/edit#slide=id.g8da6f1810_00>
accurately reflects the initial conditions you have in mind, where Carol
has obtain live references for Alice and Bob, which has quiesced into
export/import far references?
If so, I'll proceed to illustrate how I think the scenario should go, and
then compare to your's. (Especially when I'm rusty, I need pictures in
order to think clearly.)
In answer to a previous question, the step where 2-vat interactions become
3-vat interactions is makeEventualDesc at <
https://github.com/tooantuh/pauwau/blob/master/e-jsrc/net/captp/jcomm/CapTPConnection.java#L504>.
In the upcoming initial message from Carol to Alice with Bob as argument,
a', while encoding a message for Alice, asks itself to encode b' using this
function. It sees that it has a handler for this comm system, so it is a
remote reference. It then checks whether it is a remote reference with the
same connection. In this case it is not. Therefore it is a reference to a
third vat (Vat2), so it calls new3Desc to do the rest of the work.
I think it corresponds to your steps #1 and #3, which I have yet to
illustrate. Does this seem right?
Post by Mark S. Miller- Robert
I am stuck, both conceptually, as well as understanding code I wrote a
long while ago. I was hoping to gain a little insight from the list of the
insides of resolution redirection in the 3-way case. The recent change I
have made results from my thinking I finally understand the ordering that
MirandaMethods ensure. I made changes such that a whenMoreResolved
directly follows the message that generates is by adding to the front of
the msg queue.
In the 3-way case, Carol is sending a message to Alice, passing Bob.
Alice receives the message and executes, which sends a message to Bob, then
returns the result to Carol. In Alice's vat, the DelayedRedirector is
resolved to the RemotePromise of the call to Bob, the return of Alice's
computation and I think it sends whenMoreResolved to the proxy of the new
promise resolver of the send to Bob. What little tracing I have I am
posting below, as well as the DelayedRedirector value() and the
ProxyResolver resolve() code, at the bottom. However, this is my question,
what should the redirector do in Alice's Vat to propagate the resolution
from Bob, back to Carol?
Thank you,
- Robert
// 1) getTheAnswer, which returns 42,
// 2) *hashCode, again 42* and
// 3) *whenMoreResolved*, to forward to the redirector back in Alice.
which still seems to start in the middle, or I may be misunderstanding.
What does the user code do, in what initial conditions, that set the rest
of this scenario in motion?
1. Carol sends #redirectForTheAnswer to Alice::GalaxyObject with a
ref to Bob::GalaxyObject, returning a RemotePromise1
2. Carol sends #hashCode to the RemotePromise1 from the first send,
which forwards to the Promise in Alice, where it is queued.
3. 3-way: Carol sends a ProvideFor to Bob and Alice sends an
AcceptFrom to Bob, so Alice resolves Bob::GalaxyObject.
4. Alice::GalaxyObject, under computation of #redirectForTheAnswer,
sends #getTheAnswer to Bob::GalaxyObject, returning a RemotePromise2, in
Alice, from #redirectForTheAnswer.
5. The pending #hashCode send is sent to the RemothePromise2, in
Alice, which points to Bob.
6. 3-way: In Alice, the redirected #hashCode ought to become a 3-way
for the Resolver in Carol, for the intial #hashCode send. Alice would send
a ProvideFor to Carol, for that Resolver and Bob would send an AcceptFrom
to Carol to gain a FarRef to the Resolver.
7. Bob::GalaxyObject, under computation of #hashCode, returns the
value 42.
8. Bob sends the pending #hashCode to 42, and resolves the gift
Resolver.
I believe the tricky thing is that it is the Resolver which is gifted, so
it's a different export "polarization" of the minigraph for a remote send
that has been forwarded.
Thank you,
Robert
--
Cheers,
--MarkM
_______________________________________________
_______________________________________________
e-lang mailing list
http://www.eros-os.org/mailman/listinfo/e-lang
--
Cheers,
--MarkM