What are the real advantages that D offers in multithreading?

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 26 12:33:34 PST 2016


On Tue, 26 Jan 2016 11:41:49 +0000, nbro wrote:
> Does D
> offer something that other known programming languages, such as C++,
> Java and Python, do not offer?

D has in the standard runtime Fibers (aka coroutines).

You can use fibers in C++ if you find a library to do it (boost might?). 
You might be able to find a Java library for it, but it's difficult and 
might require bytecode rewriting. I think pypy has coroutines. But on the 
whole, it's a bear to find working coroutines in most languages.

Go has "goroutines", which are effectively coroutines that are entirely 
hidden from you. If you need to manage scheduling yourself, or you need 
to ensure that a particular thing is running all the time, this really 
isn't an option in Go.


More information about the Digitalmars-d mailing list