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