From: Avi Bryant Date: 2005-04-10T04:19:41+09:00 Subject: Re: Seven new VMs, all in a row Glenn Parker wrote: > Peter Suk wrote: > > > > Why is it that you'd want real threads? What can real threads do that > > Ruby VM threads can't do? The answer is synchronous calls out to OS > > services. (As well as utilizing multiple processors, but that's another > > issue.) > > Yes, I want synchronous I/O and true multi-cpu execution. And shared memory - right? Because with Ruby or Smalltalk, there's nothing stopping you from using multiple CPUs by having multiple instances of the VM, communicating through DRb or whatever. The desire for native threads comes up quite a bit in the Smalltalk world. It's interesting to see how the people at Cincom answer these questions. Of the two Smalltalks they develop, ObjectStudio and VisualWorks, one of them has native threads and the other has green threads. The engineers that build their networking and database systems always claim that the green threads scale much, much better - porting such code from VisualWorks to ObjectStudio always involves a lot of headaches in getting it to perform decently under the disadvantage of native threads. The best setup would probably be to have many green threads to each (of multiple) native thread, but that's a huge engineering effort. I think Matz made the right decision: keep things simple and under the direct control of the VM. > > At bottom, both environments use the > > "everything is an object" principle. At bottom, everything is just > > messages sent to objects. Everything is dynamic, and there is no > > "compile-time vs. runtime" divide. > > I would be more interested in your list of things that are different, > since that is where the real work will have to be done. There really aren't many. Things that Ruby has that Smalltalk doesn't (ie, would need to emulate somehow): - Optional & variable argument methods - Undeclared instance variables Things any new implementation of Ruby will need to redo: - Binary extension API - Standard libraries - Syntax That's all I can think of offhand. Avi