multithreadingmultiprocessingmulticoregreen-threads

Which scripting languages support multi-core programming?


I have written a little python application and here you can see how Task Manager looks during a typical run.
(source: weinzierl.name)

While the application is perfectly multithreaded, unsurprisingly it uses only one CPU core. Regardless of the fact that most modern scripting languages support multithreading, scripts can run on one CPU core only.

Ruby, Python, Lua, PHP all can only run on a single core. Even Erlang, which is said to be especially good for concurrent programming, is affected.

Is there a scripting language that has built in support for threads that are not confined to a single core?

WRAP UP

Answers were not quite what I expected, but the TCL answer comes close. I'd like to add perl, which (much like TCL) has interpreter-based threads.

Jython, IronPython and Groovy fall under the umbrella of combining a proven language with the proven virtual machine of another language. Thanks for your hints in this direction.

I chose Aiden Bell's answer as Accepted Answer. He does not suggest a particular language but his remark was most insightful to me.


Solution

  • Thread syntax may be static, but implementation across operating systems and virtual machines may change

    Your scripting language may use true threading on one OS and fake-threads on another.

    If you have performance requirements, it might be worth looking to ensure that the scripted threads fall through to the most beneficial layer in the OS. Userspace threads will be faster, but for largely blocking thread activity kernel threads will be better.