<div>The key word ought to be &quot;stackless&quot; as in &quot;Stackless Python.&quot; The Transputer and occam people showed long ago that multiprocessing (which is what you are really talking about here) as well as multitasking become really easy (i.e. overhead of a dozen cycles or so) if you get rid of implicitly shared resources like stack. You can still do stacky things that just take a moment (e.g. &quot;soft interrupts&quot;) but very frequently you come up for air which means your stack depth goes to 0 and then you can do all the comms and context switching you want.</div>

<div>&nbsp;</div>
<div>If Stackless lives up to its name, it should be very easy to get multiple VMs talking to each other. You just treat their comms as external comms and extend the local&nbsp;tasklet response&nbsp;to socket-like things as we were talking about in the earlier thread. Then the VMs themselves, obviously, must not share resources, or if they do, there must be very strict design control at that point.</div>

<div>&nbsp;</div>
<div>Larry Dickson<br>&nbsp;</div>
<div><span class="gmail_quote">On 11/19/08, <b class="gmail_sendername">Timothy Baldridge</b> &lt;<a href="mailto:tbaldridge@gmail.com">tbaldridge@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">What I&#39;m more looking to reduce, is the overhead of transferring data<br>from one Python VM to another. In current implementations transferring<br>
data from one VM to another requires pickling data (and that requires<br>traversing the entire object being transmitted, pickling each part<br>along the way), transmitting it across the wire, then unplickling it<br>at the other end. So where talking thousands of cycles.<br>
<br>In the method I&#39;m proposing, you could have multiple &quot;VMs&quot; in the same<br>process, with a unified GC, these VMs would would share nothing. If<br>all messages are immutable, then all that is required is to copy a<br>
pointer from one VM to the other and increment the GC ref count on the<br>message. That&#39;s what, 100-200 cycles or so (yes I did just pull that<br>out of the air).<br><br>My core idea here is that multitasking in modern languages isn&#39;t as<br>
pervasive because of the overhead/risks involved. In C you have shared<br>memory issues. In Erlang, well, many people can&#39;t stand the Erlang<br>syntax. And in Python you can&#39;t have to pass messages via<br>pipes/channels/sockets.<br>
<br>So does anyone else see this being possible, or am I off my rocker?<br><br>Timothy<br><br>_______________________________________________<br>Stackless mailing list<br><a href="mailto:Stackless@stackless.com">Stackless@stackless.com</a><br>
<a href="http://www.stackless.com/mailman/listinfo/stackless">http://www.stackless.com/mailman/listinfo/stackless</a><br></blockquote></div><br>