Multithreading in D
Sag Academy via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Oct 9 04:29:12 PDT 2014
On Thursday, 9 October 2014 at 10:10:20 UTC, Konstantin wrote:
>> Are you looking for parallel?
>> http://dlang.org/library/std/parallelism/parallel.html
>
> I have seen this, but I'm not sure how to use it.
>
> Maybe:
>
> float[][] maps = new float[#threads][resolution * resolution];
>
> foreach(i, ref elem; parallel(maps)){
> elem = generateTerrain(...);
> }
>
> Does this look right?
Yeah, it is.
More information about the Digitalmars-d-learn
mailing list