This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: implementation of std::thread::hardware_concurrency()


Ok. I correct it.

2011/11/1 Jonathan Wakely <jwakely.gcc@gmail.com>:
> I've put gcc-patches@ back in the CC list and removed gcc@
>
>
> On 1 November 2011 15:35, niXman wrote:
>>> Er, the macro _GLIBCXX_NPROCS already handles
>>> the case sysconf(_SC_NPROCESSORS_ONLN).
>>> It looks like you actually want to remove the macro
>>> _GLIBCXX_NPROCS completely.
>>
>> Fixed.
>
> No, this still isn't acceptable.
>
> I do not want to see preprocessor tests like
>
> +#elif defined(__APPLE__) || defined(__FreeBSD__)
>
> in the body of get_thread::hardware_concurrency(), the configure
> script should determine what is available on the platform and set an
> appropriate macro.
>
> Look at the definition of _GLIBCXX_NPROCS and adjust that to do
>
> #define _GLIBCXX_NPROCS pthread_num_processors_np()
>
> for the relevant platforms.
>
> For the platforms using sysctlbyname there could be an inline function
> that calls it, and _GLIBCXX_NPROCS could be defined to call that, so
> that thread::hardware_concurrency() can still be defined as it is
> today.
>
> Please read the code you're changing and understand how it works today
> before making changes.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]