D and parallel programming

Sean Kelly sean at f4.ca
Mon Aug 6 14:02:33 PDT 2007


John Burak wrote:
> I am looking into D as a possibility for a programming project I want to start.  Can someone point me to resources on how D supports parallel programming, assuming it does?  I'm surprised I didn't notice anything about parallel programming on the "d language overview" page when I scanned/searched it.  Unless it is there and I missed it (quite possible) then I think it should be added so people know what D is capable of (I'm still assuming it has some native support for parallel programming).

Support for multithreaded programming (what I assume you meant by 
"parallel programming") in D largely amounts to a standard Thread object 
in the library, as well as a "synchronized" keyword which behaves quite 
similar to the one in Java.  There is also a "volatile" keyword, but it 
is really only intended for lock-free programming and thus doesn't see 
much use outside of library code.

If it helps, Tango also contains a Fiber implementation, a read-write 
mutex, condition variables, and semaphores.  There is also a coroutine 
implementation and a CSP implementation at http://www.assertfalse.com.

I think we still have a ways to go for easily usable concurrency in D, 
but the basic building blocks are there.


Sean



More information about the Digitalmars-d mailing list