How to implement parallelization well.

Johan Granberg lijat.meREM at OVEgmail.com
Thu Jul 13 13:00:13 PDT 2006


How would one go about to implement this function effectively.

//parallel.d
///executes functions in parallel with the first function executed in the
///calling thread. returns when all threads have finished
void parallelize(void delegate()[] functions)
{
	
}
//end of file

I have hear that it is expensive to create new threads so would it bee 
wise too keep the same ones around?
The function is not responsible for any locking of shared resources so 
that part is done.

ps. am I right when I think the above can bee called as 
array.parallelize it is not important but it would bee cool :)

If wee had array literals we could do [{a();},{b();},{c();}].parallelize



More information about the Digitalmars-d mailing list