Boost logo

Boost :

Subject: Re: [boost] [thread] hardware_concurrency() not working on all platforms?
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2008-11-05 04:50:59

"Oliver Kowalke" <k-oli_at_[hidden]> writes:

> boost::thread::hardware_concurrency() seams not to work on all
> platforms (xBSD, OpenSolaris). Is there some ongoing work to provide
> this functionaly on the other platforms too?

If you know how to detect the number of processors/cores/hardware
threads on a platform for which hardware_concurrency() currently
returns the wrong number (likely 0), let me know and I'll update the

It currently works for Windows, Linux, HPUX, MacOS, FreeBSD, and any
POSIX OS that supports _SC_NPROCESSORS_ONLN with sysconf.


Anthony Williams
Author of C++ Concurrency in Action |
Custom Software Development |
Just Software Solutions Ltd, Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK

Boost list run by bdawes at, gregod at, cpdaniel at, john at