The future of concurrent programming

David B. Held dheld at codelogicconsulting.com
Tue May 29 22:51:42 PDT 2007


Sean Kelly wrote:
> [...]
> Sorry, I misundertood.  For some reason I thought you were saying Apache 
> could scale to thousands of threads.  In any case, D has something 
> roughly akin to Erlang's thread with Mikola Lysenko's StackThreads and 
> Tango's Fibers.

Erlang's threads are better than fibers because they are pre-emptive. 
However, this is only possible because Erlang runs on a VM. 
Context-switching in the VM is much cheaper than in the CPU (ironically 
enough), which means that D isn't going to get near Erlang's threads 
except on a VM that supports it (somehow I doubt the JVM or CLR come close).

Fibers are nice when you don't need pre-emption, but having to think 
about pre-emption makes the parallelism intrude on your problem-solving, 
which is what we would like to avoid.

Dave



More information about the Digitalmars-d mailing list