Distributed work load

Jacob Carlborg doob at me.com
Fri May 18 06:16:54 PDT 2012


I'm working on a tool which reads a an unknown number of files, does 
some processing on the content and writes out the result to new files on 
disk. The processing of the content is completely independent of any 
other processing, therefore I thought it might be a good idea to do this 
in parallel. So what I basically want is something like this:

foreach (file ; files)
{
     executInParallel((file) {
         auto content = read(file);
         process(content);
         write(newFile);
     });
}

"executInParallel" would then distribute this on an appropriate amount 
of threads and cores.

Is this what std.parallelism does ?

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list