llst icon indicating copy to clipboard operation
llst copied to clipboard

Research possibility of VM threading

Open 0x7CFE opened this issue 10 years ago • 0 comments

Current implementation of our VM is single threaded. LLVM itself supports the multithreading environment. However, bringing threads to VM is not so easy.

The following questions are to be answered:

  • What memory model should we use?
  • VM+GC per thread or single multithreaded VM?
  • What are the pros and cons of each way?
  • How objects from different threads will interact?
  • What synchronization primitives should be provided?
  • How Smalltalk primitives should work?
  • What to do with GC shadow stacks?

Nevertheless, multithreaded object environment appears to be very interesting. Smalltalk have very convenient design. Each and every object in the system interacts only by sending messages and receiving them. All memory accesses are bound in the messages and completely local to methods enclosing them. We have no pointers and unsafe memory operations.

Message sending procedure may transparently be converted to a remove call or call to an object from the thread nearby. Sender is completely unaware of the actual message receiver and that makes the point.

We may even think about transparent object migration from thread to thread to localize working sets, thus achieving better performance and load balancing.

0x7CFE avatar May 05 '14 11:05 0x7CFE