Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Multi-threaded VM
Last updated at 2:30 am UTC on 27 October 2007
The goal is to make the Interpreter multithreaded, while protecting ObjectMemory and Primitives with Semaphores. I have a quad-core chip and so I want 4 Interpreter threads. Only one of them can be inside of ObjectMemory at a time and that could be for purposes of allocation, mutation, or GC. It's possible that a simple mutex semaphore would suffice, initially. Ultimately, I don't think having a single ObjectMemory will scale to 10's of "processors", but will probably need to be multithreaded with one per Interpreter thread. For now it's 1 ObjectMemory and N Interpreters.


The Image Team

  1. Change the behaviour of ProcessorScheduler to behave in the same way as the multi-threaded VM. Currently code can assume that a lower priority process won't run while a higher priority process is busy; this assumption would no longer exist in the multi-threaded VM.
  2. Pick up several concurrency issues in the image.

The VM Team

  1. Duplicate Interpreter and ObjectMemory into MultithreadedInterpreter and ProtectedObjectMemory (why rename these? Just keep them in a separate package. -gulik). Create a new class, ProtectedPrimitives.
  2. Reassign functions to the appropriate classes. Primitives to ProtectedPrimitives, and so on. Change refs to variables in other classes into calls to accessors in other classes. Ditto function calls.
  3. Protect ProtectedObjectMemory and ProtectedPrimitives with Semaphores to guard against concurrent access.
  4. Implement a MultithreadedVMSimulator and simulate the new VM.

The CrossCompiler Team

  1. Understand CCodeGenerator and TParseNode hierarchy.
  2. Consider having retargetable CodeGeneration. The structure of the parse tree will be the same, reflecting an OO design, but the backend could use a visitor pattern, or something, to generate C++ or C or something else that is fast.
  3. Duplicate/Extend the CCodeGenerator and the TParseNode hierarchy to build from input classes and generate code.
  4. Cross-compile, compile and run