problem with parallel foreach

thedeemon via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 12 20:19:16 PDT 2015


On Tuesday, 12 May 2015 at 20:50:45 UTC, Gerald Jansen wrote:

> Your advice is appreciated but quite disheartening. I was 
> hoping for something (nearly) as easy to use as Python's 
> parallel.Pool() map(), given that this is essentially an 
> "embarassingly parallel" problem. Avoidance of GC allocation 
> and  self-written buffered IO functions seems a bit much to ask 
> of a newcomer to a language.

You're right, these are issues of D's standard library that are 
not easy for a newcomer to tackle. In case of Python's 
parallel.Pool() separate processes do the work without any 
synchronization issues. In case of D's std.parallelism it's just 
threads inside one process and they do fight for some locks, thus 
this result.


More information about the Digitalmars-d-learn mailing list