Range and poolTask

Rene Zwanenburg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 6 02:38:32 PDT 2016


On Monday, 6 June 2016 at 09:32:30 UTC, moechofe wrote:
> I wonder if it is possible to write something like this:
> ---
> // taskPool.distribute -- take a range and distribute entries 
> to different threads.
> dirEntries().distribute(function(R1,R2)(R1 from,R2 to){
> 	from
> 	.filter!xxx
> 	.map!yyy
> 	.tee!zzz(to);
> })
> .each!www;
> ---
> This would be great.

This might be useful:

http://dlang.org/phobos/std_parallelism.html#.TaskPool

Or, more specifically,

http://dlang.org/phobos/std_parallelism.html#.TaskPool.amap
http://dlang.org/phobos/std_parallelism.html#.TaskPool.map


More information about the Digitalmars-d-learn mailing list