[Vm-dev] Multiprocessing with Squeak

Levente Uzonyi leves at elte.hu
Wed Jan 27 22:04:05 UTC 2010


Hi,

I had an idea a few days ago and even though I don't have the time or 
knowledge to try it myself, I just can't get it out of my head. The idea 
is to let an interpreter use two images at once. One of them is read only 
"fully working" image let's call it S (source), the other is empty 
(contains no objects), writeable, possibly generated on the fly, let's 
call it W (working). The vm knows if an object is in S or W by checking 
the object pointer. Whenever an object in S is about to be modified, a 
copy is created in W and all references to it are changed to the new one 
(which means that more than one object might have to be copied). This 
means a slower startup, but once all necessary objects are copied 
performance would be normal.
(This approach is similar to the way sources are handled today: the 
sources file is read only, new source code goes to the changes file.)

What are the benefits?
- the source image can be shared among interpreters (even vms)
- the garbage collector has much less work, since it only has to check the
   objects in W

How does it help with multiprocessing?
- combine it with HydraVM, it might give Erlang-like capabilities (cheap
   and fast processes)
- reduces memory usage if multiple interpreters (vms) use the same source
   image

Possible caveats?
- too many objects might have to be copied after startup (this is
   solveable, see below)
- too many objects might have to be copied overall (this is unlikely, but
   who knows)
- ? (you name it)

Possible enhancements
- let the interpreter use a not-empty, possibly user-specified, W image
   for quick startup

Opinions? Ideas?


Levente


More information about the Vm-dev mailing list