Re: Using Vine in 3-way interactions (was Re: Question on redirectors/whenMoreResolved in the 3-way case, in the middle vat)

"Mark S. Miller" <[email protected]> Tue, 10 Mar 2015 12:31:31 -0700
Newsgroups gmane.comp.lang.e.general
Message-ID <CABHxS9idciVhEZ6AX=v3tjSUSnftFyJrnTyZ9N3SQ8XVxbAcNA@mail.gmail.com>
--===============3806528738847502740==
Content-Type: multipart/alternative; boundary=001a11404078af63d20510f432b7

--001a11404078af63d20510f432b7
Content-Type: text/plain; charset=UTF-8

Hi Rob, just letting you know that it will be a few days till I can get
back to this. I'm currently in the middle of a realtime situation.

On Tue, Mar 10, 2015 at 11:56 AM, Rob Withers <[email protected]>
wrote:

>
>
> On 3/8/2015 7:35 PM, Rob Withers wrote:
>
>
> On 3/8/2015 5:58 PM, Mark S. Miller wrote:
>
>
>
> On Sun, Mar 8, 2015 at 7:33 AM, Rob Withers <[email protected]>
> wrote:
>
>>  I 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
> the GalaxyObject, the test object:
>
> 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");
>
>
>
> - Robert
>
>       On 2/22/2015 6:19 PM, Rob Withers wrote:
>>
>> 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
>>
>>
>> // There are 3 messages sent to Bob, from Alice:
>> //     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 [email protected]://www.eros-os.org/mailman/listinfo/e-lang
>
>
>
>
> _______________________________________________
> e-lang mailing list
> [email protected]
> http://www.eros-os.org/mailman/listinfo/e-lang
>
>


-- 
    Cheers,
    --MarkM

--001a11404078af63d20510f432b7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Rob, just letting you know that it will be a few days t=
ill I can get back to this. I&#39;m currently in the middle of a realtime s=
ituation.</div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On=
 Tue, Mar 10, 2015 at 11:56 AM, Rob Withers <span dir=3D"ltr">&lt;<a href=
=3D"mailto:[email protected]" target=3D"_blank">robert.w.withers@g=
mail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000"><span class=3D"">
    <br>
    <br>
    <div>On 3/8/2015 7:35 PM, Rob Withers wrote:<br>
    </div>
    <blockquote type=3D"cite">
     =20
      <br>
      <div>On 3/8/2015 5:58 PM, Mark S. Miller
        wrote:<br>
      </div>
      <blockquote type=3D"cite">
        <div dir=3D"ltr"><br>
          <div class=3D"gmail_extra"><br>
            <div class=3D"gmail_quote">On Sun, Mar 8, 2015 at 7:33 AM, Rob
              Withers <span dir=3D"ltr">&lt;<a href=3D"mailto:robert.w.with=
[email protected]" target=3D"_blank">[email protected]</a>&gt;</span>
              wrote:<br>
              <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left=
-style:solid;padding-left:1ex">
                <div bgcolor=3D"#FFFFFF" text=3D"#000000"> I had not
                  realized I had posed such a challenging situation.=C2=A0 =
In
                  mulling over what needs to happen, I think the
                  followOn message send (#hashCode) needs to be a 3-vat
                  situation, <b>of the Resolver</b>, to prevent GC.=C2=A0
                  Here are the steps I think are needed, #6 being the
                  point where my system is failing, due to its absence?
                  <br>
                </div>
              </blockquote>
              <div><br>
              </div>
              <div>Hi Rob, I don&#39;t think I understand the scenario
                that&#39;s driving this. I went back to the beginning of th=
e
                thread and found</div>
            </div>
          </div>
        </div>
      </blockquote>
      <br>
      Hi Mark, I suppose it is best to just post the pertinent code.
      First is the GalaxyObject, the test object:<br>
      <br>
      <font face=3D"Palatino Linotype" size=3D"-2">public class GalaxyObjec=
t
        {</font><br>
      <font face=3D"Palatino Linotype" size=3D"-2">=C2=A0=C2=A0=C2=A0 publi=
c int
        getTheAnswer() { return 42; }</font><br>
      <font face=3D"Palatino Linotype" size=3D"-2">=C2=A0=C2=A0=C2=A0 publi=
c Ref
        redirectForTheAnswer(Ref ref) throws NotResolvedException {
        return ref.redirectMessage(&quot;getTheAnswer&quot;); }</font><br>
      <font face=3D"Palatino Linotype" size=3D"-2">}</font><br>
    </blockquote>
    <br></span>
    Hi Mark, does this make sense?=C2=A0 redirectForTheAnswer sends
    getTheAnswer to the arg Ref and returns the promise.=C2=A0 In the code
    below, the arg Ref is Bob, a GalazyObject in a third Vat, so the
    return of redirectForTheAnswer is a RemotePromise.=C2=A0 THe follow on
    message below is #hashCode, is sent to this RemotePromise.<span class=
=3D""><br>
    =C2=A0 <br>
    <blockquote type=3D"cite"><font face=3D"Palatino Linotype" size=3D"-2">=
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Ref answer =3D
        alice.redirectMessage(&quot;redirectForTheAnswer&quot;,
        bob).redirectMessage(&quot;hashCode&quot;);<br>
        =C2=A0 </font><br>
    </blockquote>
    <br></span><div><div class=3D"h5">
    - Robert<br>
    <br>
    <blockquote type=3D"cite">
      <blockquote type=3D"cite">
        <div dir=3D"ltr">
          <div class=3D"gmail_extra">
            <div class=3D"gmail_quote">
              <div>
                <blockquote type=3D"cite">
                  <div class=3D"gmail_extra">
                    <div class=3D"gmail_quote">
                      <blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);bor=
der-left-style:solid;padding-left:1ex">
                        <div bgcolor=3D"#FFFFFF" text=3D"#000000">
                          <div> On 2/22/2015 6:19 PM, Rob Withers wrote:<br=
>
                          </div>
                          <blockquote type=3D"cite">I am stuck, both
                            conceptually, as well as understanding code
                            I wrote a long while ago.=C2=A0 I was hoping to
                            gain a little insight from the list of the
                            insides of resolution redirection in the
                            3-way case.=C2=A0 The recent change I have made
                            results from my thinking I finally
                            understand the ordering that MirandaMethods
                            ensure.=C2=A0 I made changes such that a
                            whenMoreResolved directly follows the
                            message that generates is by adding to the
                            front of the msg queue.=C2=A0=C2=A0<br>
                            <br>
                            In the 3-way case, Carol is sending a
                            message to Alice, passing Bob.=C2=A0 Alice
                            receives the message and executes, which
                            sends a message to Bob, then returns the
                            result to Carol.=C2=A0 In Alice&#39;s vat, the
                            DelayedRedirector is resolved to the
                            RemotePromise of the call to Bob, the return
                            of Alice&#39;s computation and I think it sends
                            whenMoreResolved to the proxy of the new
                            promise resolver of the send to Bob.=C2=A0 What
                            little tracing I have I am posting below, as
                            well as the DelayedRedirector value() and
                            the ProxyResolver resolve() code, at the
                            bottom.=C2=A0 However, this is my question, wha=
t
                            should the redirector do in Alice&#39;s Vat to
                            propagate the resolution from Bob, back to
                            Carol?<br>
                            <br>
                            Thank you,<br>
                            - Robert<br>
                            <br>
                            <br>
                            // There are 3 messages sent to Bob, from
                            Alice:<br>
                            // =C2=A0=C2=A0=C2=A0 1) getTheAnswer, which re=
turns 42,=C2=A0<br>
                            // =C2=A0=C2=A0=C2=A0 2)=C2=A0<b>hashCode, agai=
n 42</b>=C2=A0and=C2=A0<br>
                            //=C2=A0=C2=A0 =C2=A0 3)=C2=A0<b>whenMoreResolv=
ed</b>, to
                            forward to the redirector back in Alice.<br>
                          </blockquote>
                        </div>
                      </blockquote>
                    </div>
                  </div>
                </blockquote>
              </div>
              <div><br>
              </div>
              <div>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?</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>=C2=A0</div>
              <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left=
-style:solid;padding-left:1ex">
                <div bgcolor=3D"#FFFFFF" text=3D"#000000">
                  <ol>
                    <li>Carol sends #redirectForTheAnswer to
                      Alice::GalaxyObject with a ref to
                      Bob::GalaxyObject, returning a RemotePromise1</li>
                    <li>Carol sends #hashCode to the RemotePromise1 from
                      the first send, which forwards to the Promise in
                      Alice, where it is queued.<br>
                    </li>
                    <li>3-way: Carol sends a ProvideFor to Bob and Alice
                      sends an AcceptFrom to Bob, so Alice resolves
                      Bob::GalaxyObject.</li>
                    <li>Alice::GalaxyObject, under computation of
                      #redirectForTheAnswer, sends #getTheAnswer to
                      Bob::GalaxyObject, returning a RemotePromise2, in
                      Alice, from #redirectForTheAnswer.</li>
                    <li>The pending #hashCode send is sent to the
                      RemothePromise2, in Alice, which points to Bob.</li>
                    <li>3-way: In Alice, the redirected #hashCode ought
                      to become a 3-way for the Resolver in Carol, for
                      the intial #hashCode send.=C2=A0 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.</li>
                    <li>Bob::GalaxyObject, under computation of
                      #hashCode, returns the value 42.</li>
                    <li>Bob sends the pending #hashCode to 42, and
                      resolves the gift Resolver. </li>
                  </ol>
                  I believe the tricky thing is that it is the Resolver
                  which is gifted, so it&#39;s a different export
                  &quot;polarization&quot; of the minigraph for a remote se=
nd that
                  has been forwarded. <br>
                  <br>
                  Thank you,<br>
                  Robert<br>
                  <br>
                </div>
              </blockquote>
            </div>
            <br clear=3D"all">
            <div><br>
            </div>
            -- <br>
            <div>=C2=A0 =C2=A0 Cheers,<br>
              =C2=A0 =C2=A0 --MarkM</div>
          </div>
        </div>
        <br>
        <fieldset></fieldset>
        <br>
        <pre>_______________________________________________
e-lang mailing list
<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
os-os.org</a>
<a href=3D"http://www.eros-os.org/mailman/listinfo/e-lang" target=3D"_blank=
">http://www.eros-os.org/mailman/listinfo/e-lang</a>
</pre>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
e-lang mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a href=3D"http://www.eros-os.org/mailman/listinfo/e-lang" target=3D"_blank=
">http://www.eros-os.org/mailman/listinfo/e-lang</a><br>
<br></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div cla=
ss=3D"gmail_signature">=C2=A0 =C2=A0 Cheers,<br>=C2=A0 =C2=A0 --MarkM</div>
</div>

--001a11404078af63d20510f432b7--

--===============3806528738847502740==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
e-lang mailing list
[email protected]
http://www.eros-os.org/mailman/listinfo/e-lang

--===============3806528738847502740==--