<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Igor, why don't you add your ideas to <A href="http://wiki.squeak.org/squeak/6012">http://wiki.squeak.org/squeak/6012</A>.&nbsp;&nbsp;&nbsp; . . .</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Igor Stasenko <A href="mailto:siguctua@gmail.com">siguctua@gmail.com</A><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&gt; On 30/10/2007, Rob Withers &lt;<A href="mailto:reefedjib@yahoo.com" ymailto="mailto:reefedjib@yahoo.com"><FONT color=#0000ff>reefedjib@yahoo.com</FONT></A>&gt; wrote:<BR>&gt; </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&gt; &gt; It seems to me that you are building event-loops in the VM.&nbsp; Consider<BR>&gt; &gt; anObject that is sent a msg on thread 1, so he is assigned to thread 1 and<BR>&gt; &gt; you start processing it with thread 1.&nbsp; In the meantime, 3 msgs are sent to<BR>&gt; &gt; this object on threads 2, 3, and 4.&nbsp; Each message send is scheduled for<BR>&gt; &gt; processing by thread 1, when it becomes available.&nbsp; There is your<BR>&gt; &gt; event-loop.<BR>&gt; &gt;<BR>&gt; <BR>&gt; Yes, exactly. I'm still unsure if it really needed for all objects in<BR>&gt; system. For instance, the true/false/nil object are just singletons<BR>&gt; without any internal state. Thus scheduling them into single thread of<BR>&gt; execution can be simply omitted.<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">The same goes for SmallIntegers, which while not singletons, are not mutable.&nbsp; Perhaps Characters are also candidates for this.&nbsp; These are PassByConstruction objects, which means they are always local.&nbsp; PassByCopy is another type of PassByConstruction, where a copy is marshalled to the other side.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&gt; The other thing which bothers me is a reflection. Should we expose a<BR>&gt; properties of native threads at language side (for using/showing them<BR>&gt; in debugger)? Or how well new contexts will deal with continuations,<BR>&gt; which is used in seaside..<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">I think each process should know which thread id it is running in.&nbsp; In my model, the process stays with the thread, while in yours I am not sure.&nbsp; A message to a VatRef to an object in a different Vat, would be sent asynchronously and scheduled in the other Vat for it's thread to process.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">BTW, in another email you asked about how passing a ref between Vats (Islands) guaranteed that all msgs to it would go to the home Vat.&nbsp; The answer is that a ref to a Vat local object, being passed as an arg to a msg send to a VatRef to an object in a different Vat, would be translated into a VatRef back to the origin Vat when the MsgSend marshalled it's arguments to the 2nd Vat.&nbsp; No ref with direct memory access would ever be allowed to be passed to another Vat.<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&gt; &gt; But the primitive may have internal state that can't be shared.<BR>&gt; <BR>&gt; <BR>&gt; I know, but i'm talking about basic primitives which used most<BR>&gt; frequently and operating only with object memory. Such primitives<BR>&gt; usually don't have any internal state, or using an interpreter state.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Ok, so from the link above, the ProtectedPrimitives would not always be protected.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>&gt; <BR>&gt; All other primitives which have internal state should be reviewed.<BR>&gt; And at first stages we could add support for scheduling all these<BR>&gt; 'old' primitives into single 'main' thread. So they will work as in<BR>&gt; current VM not knowing that VM is actually multithreaded.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">I was thinking we mutex protect them, but still allow different threads to use them.<BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&gt; I'd like to hear more critics about such model :) If it proves to be<BR>&gt; viable and much or less easily doable (comparing to other models) then<BR>&gt; i could start working on it :)<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Go for it!!</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">cheers,<BR>Rob</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div></body></html>