Like I mentioned afterwards, I tried a different number of threads. On my machine, at least, std.parallelism.totalCPUs returns 8, the number of virtual cores. As it should.

Atila

On Sunday, 4 May 2014 at 07:49:51 UTC, Russel Winder via Digitalmars-d wrote:
On Sat, 2014-05-03 at 19:37 +0000, Atila Neves via Digitalmars-d wrote:
[…]
I'm using parallel and taskPool from std.parallelism. I was under the impression it gave me a ready-to-use pool with as many threads as I have cores.

There is a default, related to the number of cores the OS thinks there is (*), but you can also set the number manually. std.parallelism could
do with some work to make it better than it already is.


(*) Physical cores are not necessarily the number reported by the OS due to core hyperthreads. Quad core no hyperthreads, and dual core, two hyperthreads per core, both get reported as four processor systems. However if you benchmark them you get very, very different performance
characteristics.

Reply via email to