Nico and Howard,

Nico Rieck <[email protected]> writes:

> On 02.07.2013 19:53, Howard Hinnant wrote:
>> +#elif defined(_WIN32)
>> +    SYSTEM_INFO info;
>> +    GetSystemInfo(&info);
>> +    return info.dwNumberOfProcessors;
>>   #else  // defined(CTL_HW) && defined(HW_NCPU)
>
> I'm not that familiar with the implementation for the other platforms,
> but this snippet returns the number of logical processors. In my local
> Windows port I use the number of cores, as I think that's more
> appropriate. This is also what MSVCRT does on Windows.

As per my interpretation of the standard, returning the number of
logical processors is the right thing.

I checked VS2013 on a hyperthreaded machine and
std::thread::hardware_concurrency does just that. Same for
boost::thread::hardware_concurrency.

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to