Concurrency and program speed
Joseph Rushton Wakeling
joseph.wakeling at webdrake.net
Fri Mar 1 03:47:50 PST 2013
On 03/01/2013 11:43 AM, thedeemon wrote:
> Two ideas coming to mind:
> 1) Amdahl's law. If there is some locking inside random numbers generator, you
> will never get linear speed up.
I had some concerns here. rndGen is supposed to be thread-safe, which was
incidentally why I was using std.concurrency; I'm not sure if the same safety
occurs with std.parallelism.
> 2) More probable: the "4 cores" of your laptop might be just 2 cores with
> hyperthreading, that's not honest 4 cores, they won't give you 4x speedup anywhere.
Yes, this turns out to be the case, so is the most likely cause. Your results
and Jerro's suggest that with a greater number of true cores, an appropriate
speedup results.
Thanks to both of you for the thoughts and advice!
More information about the Digitalmars-d-learn
mailing list