<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>. . . .</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </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">> On 30/10/2007, Rob Withers <<A href="mailto:reefedjib@yahoo.com" ymailto="mailto:reefedjib@yahoo.com"><FONT color=#0000ff>reefedjib@yahoo.com</FONT></A>> wrote:<BR>> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">> > It seems to me that you are building event-loops in the VM. Consider<BR>> > anObject that is sent a msg on thread 1, so he is assigned to thread 1 and<BR>> > you start processing it with thread 1. In the meantime, 3 msgs are sent to<BR>> > this object on threads 2, 3, and 4. Each message send is scheduled for<BR>> > processing by thread 1, when it becomes available. There is your<BR>> > event-loop.<BR>> ><BR>> <BR>> Yes, exactly. I'm still unsure if it really needed for all objects in<BR>> system. For instance, the true/false/nil object are just singletons<BR>> without any internal state. Thus scheduling them into single thread of<BR>> 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. Perhaps Characters are also candidates for this. These are PassByConstruction objects, which means they are always local. 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"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">> The other thing which bothers me is a reflection. Should we expose a<BR>> properties of native threads at language side (for using/showing them<BR>> in debugger)? Or how well new contexts will deal with continuations,<BR>> 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. In my model, the process stays with the thread, while in yours I am not sure. 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"> </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. 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. 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"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">> > But the primitive may have internal state that can't be shared.<BR>> <BR>> <BR>> I know, but i'm talking about basic primitives which used most<BR>> frequently and operating only with object memory. Such primitives<BR>> 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"> </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>> <BR>> All other primitives which have internal state should be reviewed.<BR>> And at first stages we could add support for scheduling all these<BR>> 'old' primitives into single 'main' thread. So they will work as in<BR>> current VM not knowing that VM is actually multithreaded.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </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">> I'd like to hear more critics about such model :) If it proves to be<BR>> viable and much or less easily doable (comparing to other models) then<BR>> 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"> </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>