Question
Will isolates in Dart run in parallel utilizing all available cores on a multiple core environment, or will it multiplex on a single core?
Background
Google has described isolates (a single-threaded unit of concurrency) in the Dart programming language as a "light weight thread" that operates on the main stack, without blocking.
Thus, it seems to me as it will only be able to multiplex on a single core and not be able to run in parallel over multiple cores in a SMP, dualcore, multicore or clustered environment.
Though, I can't find any information on this, hence my humble question.
I looked it up. The isolates seem to be actual threads.
Very good, except
Not at all good, because of the messages:
Very bad.
This scheme would seem to make it impossible to communicate large amounts of data from one isolate to another without copying it, so eliminating efficient interisolate communication.
I would not use it because of this restriction that disallows the passing of large objects/buffers by address, as one would normally do with conventional threads.
It looked interesting at first, because I use almost exclusively message-passing designs, but they knackered the inter-thread comms by insisting on only private heaps.
Here is updated code for Dart 1.0.
Warning: the code below is out of date and does not work with Dart 1.0.
Short answer
Maybe.
Long Answer
The dart:isolate library guide states: "Isolates might run in a separate process or thread, depending on the implementation. For web applications, isolates can be compiled to Web workers, if they are available." (my emphasis)
Running this code and observing your CPU load will tell you if your implementation does this or not.
The standalone dartvm will run isolates in parallel, utilizing all available cores. Browser implementations of Dart will likely vary depending on whether Web Workers are implemented or not.