Parallelism in D?

Tim Burrell tim at timburrell.net
Fri Mar 28 10:31:52 PDT 2008


Ansible wrote:
> Parallel programming being the Next Big Thing these days, I'm wondering 
> what is out there as far as parallel programming 
> libraries/utilities/whatever for D?
> 
> Has anyone created a D layer for MPI, for instance?  What about 
> transactional memory?
> 
> I have a game engine that I wrote in C++ and I'm thinking about porting 
> to D one of these days.  Making use of those extra cores is high on the 
> priority list for me in the future.

I'm with you.  OpenMP support (or something similar) would really be 
ideal.  I think if D wants to continue to sway developers from other 
system languages parallel support is a must have.  Maybe gdc could be a 
reasonable path to OpenMP as it already has support for C and C++ (and I 
think Obj-C too).

Honestly even MPI isn't really sufficient these days.  MPI is [sort-of] 
great for doing clustered / distributed stuff, but no where near where 
we need to be for SMP / shared memory parallelism.

Pretty much every C++ compiler has OpenMP support these days, so it's a 
bit sad to see D lagging in this respect.  OpenMP is by no means the 
be-all / end-all of parallelism, but it's a lot better than nothing.

I get why it's a non-trivial thing for D -- first of all the use of mark 
/ sweep style GC means parallelism is more difficult.  Obviously you 
can't have a parallel system where every thread is halted whenever a 
sweep occurs, so I suspect some fairly major redesign would have to 
occur?  I'm open to being wrong about this though...

Personally I think a more advanced memory management scheme would be a 
good thing anyway, but perhaps that's just me :).


More information about the Digitalmars-d-learn mailing list