Parallelization of a large array

Dennis Ritchie via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 10 13:41:12 PDT 2015


Hi.
How to parallelize a large array to check for the presence of an 
element matching the value with the data?

std.stdio;
std.algorithm;
std.parallelism;

void main() {

	int[] a = new int[1000000];

	foreach (i, ref elem; a)
		elem = i;

	/*if (find(parallel(a), 895639).length != 0)
		writeln("Yes");
	else
		writeln("No");*/
}


More information about the Digitalmars-d-learn mailing list