<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>Re: Asynchronous Messaging</title></head><body>
<div>Stephen,<br>
<br>
I've been eager to play with your code ever since you posted it, and
now that I finally had the chance I have to say it's absolutely
wonderful!<br>
<br>
Of course, one of the first things I did was add &quot;Trampoline&quot;
support so you can now use direct messaging syntax such as:<br>
<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>jeff asend
name:'Jeff Smith'.<br>
instead of<br>
<x-tab> </x-tab>jeff asend:#name: with:#('Jeff Smith').<br>
<br>
However, I am having problems with parts of the code, especially with
#send: sometimes being implemented as a straight #asend: (and
potentially deadlocking if not), the mysterious #answer:
implementation (what is at:3 ? -- it fails with some of my mods) etc.&nbsp;
<br>
<br>
Maybe you could explain your code a little?<br>
<br>
Regards,<br>
<br>
Marcel<br>
<br>
Attached, an updated/downgraded changeset.<br>
&lt;attachment missing&gt;<br>
<br>
<br>
&gt; From: &quot;Stephen Pair&quot; &lt;spair@advantive.com&gt; <br>
&gt;<br>
&gt; A week or two ago there was a lengthy discussion on the topic of
coroutines <br>
&gt; vs. sub-routines that peaked my interest quite a bit.&nbsp; To
educate myself a <br>
&gt; little more on the topic, I wrote a small asynchronous messaging
capability. <br>
&gt; Basically, each object has a message queue, and each method
context has an <br>
&gt; answer queue.&nbsp; Multiple answers can be passed back to a
sender through this <br>
&gt; answer queue.&nbsp; Messages can be sent synchronously,
asynchrounsly, or queued <br>
&gt; asynchronously.&nbsp; The interesting thing to me is that it
seems like the whole <br>
&gt; notion of processes could go away, leaving only method (or block)
contexts <br>
&gt; to be scheduled.&nbsp; Also of interest is the notion that a
stack architecture <br>
&gt; really only handles the specialized case of a synchronous message
send.&nbsp; I <br>
&gt; believe these things we're discussed at length in the previous
thread. <br>
&gt;&nbsp; <br>
&gt; Anyway, I had fun exploring the topic and thought I'd share the
code...I'd <br>
&gt; be curious to know more about how the Smalltalk-72 system worked.
<br>
&gt;&nbsp; <br>
&gt; The change set is at http://www.advantive.com/squeak <br>
&gt;&nbsp; <br>
&gt; - Stephen <br>
&gt;&nbsp; <br>
&gt;&nbsp; <br>
&gt;&nbsp; <br>
</div>
<div><font face="Helvetica">Stephen,</font></div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica">I've been eager to play with your code
ever since you posted it, and now that I finally had the chance I have
to say it's absolutely wonderful!</font></div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica">Of course, one of the first things I did
was add &quot;Trampoline&quot; support so you can now use direct
messaging syntax such as:</font></div>
<div><font face="Helvetica"><br></font></div>
<div><font
face="Helvetica"><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>jeff asend name:'Jeff Smith'.</font></div>
<div><font face="Helvetica">instead of</font></div>
<div><font
face="Helvetica"><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>jeff asend:#name: with:#('Jeff Smith').</font></div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica">However, I am having problems with parts
of the code, especially with #send: sometimes being implemented as a
straight #asend: (and potentially deadlocking if not), the mysterious
#answer: implementation (what is at:3 ? -- it fails with some of my
mods) etc.&nbsp; </font></div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica">Maybe you could explain your code a
little?</font></div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica">Regards,</font></div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica">Marcel</font></div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica">Attached, an updated/downgraded
changeset.</font></div>
<div><br>
content-type: application/octet-stream; x-unix-mode=0644;
name=ASyncMsg.23Jun717am.cs<br>
<br>
Attachment converted: Anon:ASyncMsg.23Jun717am.cs (????/----)
(0000AD07)</div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica"><br></font></div>
<div><font face="Helvetica">&gt; From: &quot;Stephen Pair&quot;
&lt;spair@advantive.com&gt; </font></div>
<div><font face="Helvetica">&gt;</font></div>
<div><font face="Helvetica">&gt; A week or two ago there was a lengthy
discussion on the topic of coroutines </font></div>
<div><font face="Helvetica">&gt; vs. sub-routines that peaked my
interest quite a bit.&nbsp; To educate myself a </font></div>
<div><font face="Helvetica">&gt; little more on the topic, I wrote a
small asynchronous messaging capability. </font></div>
<div><font face="Helvetica">&gt; Basically, each object has a message
queue, and each method context has an </font></div>
<div><font face="Helvetica">&gt; answer queue.&nbsp; Multiple answers
can be passed back to a sender through this </font></div>
<div><font face="Helvetica">&gt; answer queue.&nbsp; Messages can be
sent synchronously, asynchrounsly, or queued </font></div>
<div><font face="Helvetica">&gt; asynchronously.&nbsp; The interesting
thing to me is that it seems like the whole </font></div>
<div><font face="Helvetica">&gt; notion of processes could go away,
leaving only method (or block) contexts </font></div>
<div><font face="Helvetica">&gt; to be scheduled.&nbsp; Also of
interest is the notion that a stack architecture </font></div>
<div><font face="Helvetica">&gt; really only handles the specialized
case of a synchronous message send.&nbsp; I </font></div>
<div><font face="Helvetica">&gt; believe these things we're discussed
at length in the previous thread. </font></div>
<div><font face="Helvetica">&gt;&nbsp; </font></div>
<div><font face="Helvetica">&gt; Anyway, I had fun exploring the topic
and thought I'd share the code...I'd </font></div>
<div><font face="Helvetica">&gt; be curious to know more about how the
Smalltalk-72 system worked. </font></div>
<div><font face="Helvetica">&gt;&nbsp; </font></div>
<div><font face="Helvetica">&gt; The change set is at
http://www.advantive.com/squeak </font></div>
<div><font face="Helvetica">&gt;&nbsp; </font></div>
<div><font face="Helvetica">&gt; - Stephen </font></div>
<div><font face="Helvetica">&gt;&nbsp; </font></div>
<div><font face="Helvetica">&gt;&nbsp; </font></div>
<div><font face="Helvetica">&gt;&nbsp; </font></div>
</body>
</html>