Boost logo

Boost Users :

Subject: Re: [Boost-users] number cores / cpu
From: Lars Viklund (zao_at_[hidden])
Date: 2010-08-23 09:02:04


On Mon, Aug 23, 2010 at 02:57:49PM +0200, Kraus Philipp wrote:
> can I determine how many physical cpu and cores are installed in a
> system with the boost lib?

There's thread::hardware_concurrency() which will give you a count of
hardware threads.

Personally, if I wanted more specific knowledge, I'd use /proc on Linux,
WMI on Windows, etc., conditionally compiled.

[1] http://www.boost.org/doc/libs/1_44_0/doc/html/thread/thread_management.html#thread.thread_management.thread.hardware_concurrency

-- 
Lars Viklund | zao_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net