Re: std.parallelism taskPool.map example throws exception

2015-08-07 Thread Jay Norwood via Digitalmars-d-learn
Unfortunately, this is not a very good example for std.parallelism, since the measured times are better using the std.algorithm.map calls. I know from past experience that std.parallelism routines can work well when the work is spread out correctly, so this example could be improved. This is

Re: std.parallelism taskPool.map example throws exception

2015-08-07 Thread Jay Norwood via Digitalmars-d-learn
and, finally, this works using the taskPool.map, as in the std.parallelism example. So, the trick appears to be that the call to chomp is needed. auto lineRange = File(fn).byLineCopy(); auto chomped = std.algorithm.map!"a.chomp"(lineRange); auto nums = taskPool.map!(to!

Re: std.parallelism taskPool.map example throws exception

2015-08-07 Thread Jay Norwood via Digitalmars-d-learn
This also works. auto sm = File(fn).byLineCopy() .map!"a.chomp"() .map!(to!double) .map!"a.log10"() .sum(); writeln("sum=",sm);

Re: std.parallelism taskPool.map example throws exception

2015-08-07 Thread Jay Norwood via Digitalmars-d-learn
This appears to work ... at least, no exception: auto sm = File(fn).byLine(KeepTerminator.no) .map!"a.chomp"() .map!"a.idup"() .map!(to!double) .map!"a.log10"() .sum(); writeln("sum=",sm);