4 ms·
Can Pharo/Squeak programs utilize multiple cores? Last I checked, they used green threads and there weren't any plans to add true multi-threading.
by echoless 12y ago
Can Pharo/Squeak programs utilize multiple cores? Last I checked, they used green threads and there weren't any plans to add true multi-threading.
- needusername 12y ago> Last I checked, they used green threads and there weren't any plans to add true multi-threading. That is correct. My understanding is that supporting multiple hardware threads would require major work in the VM and the development of a memory model. There's some quite critical code in there relies on certain things not being a point for a possible context switch.
- echoless 12y agoIsn't that a big setback for adoption though? The world is moving to multiple-cores, albeit slowly.
- needusername 12y agoIt's hard to tell. If you compare yourself with traditional scripting languages like CRuby, CPython, JavaScript, Perl, PHP, Lua, … — they all use green threads as well. If you compare yourself to C++, C#, Java then things look differently. It's probably a bigger issue for the commercial Smalltalk vendors. I would assume for a free, open source project this can be "forgiven" more easily.
- dragonwriter 12y ago> It's hard to tell. If you compare yourself with traditional scripting languages like CRuby, CPython, JavaScript, Perl, PHP, Lua, … — they all use green threads as well. "CRuby" (MRI) since 1.9 and "CPython" (forever, as far as I know) use native threads with a global runtime lock so only one thread running Ruby/Python code (but possibly more running native code in the same process) runs at any given time. AFAIK, most JS environments don't provide threads (green or otherwise).
- Mikeb85 12y agoSmalltalk uses multiple cores by forking processes and passing messages, just like JavaScript, Ruby, Python, etc...
- Rockslide 12y agoIt is true that you can fork in Smalltalk. It is not true that such a fork results in multiple cores being used by the same VM concurrently. At least not in any of the "mainstream" Smalltalk implementations I know (which would be Squeak, Pharo and VisualWorks).
- shaunxcode 12y agoCheck out the work on roar vm https://github.com/smarr/RoarVM https://github.com/smarr/RoarVM if you are interested in such things. There are rad videos here too: http://stefan-marr.de/renaissance/ http://stefan-marr.de/renaissance/