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()


On 1 November 2011 16:01, Jonathan Wakely wrote:
> On 1 November 2011 15:57, niXman wrote:
>>> What header is required for pthread_num_processors_np?
>> pthread.h
>
> OK.
>
> This assumes that Pthreads is the only abstraction available on __hpux
> (i.e. that if _GLIBCXX_HAS_GTHREADS is true then we have already
> included <pthread.h>):
>
> +#if defined(PTW32_VERSION) || \
> + ? (defined(__MINGW64_VERSION_MAJOR) && defined(_POSIX_THREADS)) || \
> + ? defined(__hpux)
>
> Is that assumption safe?

OK, gthr-dec.h includes <pthread.h> so I think it is safe.

Do all supported versions of Pthreads-win32, mingw64 and HPUX define
pthread_num_processors_np() in <pthread.h>?  They might not, which is
why there should be a configure test checking for the availability of
that function, which sets a macro such as
_GLIBCXX_USE_PTHREAD_NUM_PROCESSORS_NP, which is then checked in
src/thread.cc


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