std::thread::hardware_concurrency

From Cppreference

Jump to: navigation, search
static unsigned hardware_concurrency();
(C++11 feature)

Returns number of concurrent threads supported by the implementation. The value should be considered only a hint.

Contents

[edit] Parameters

(none)

[edit] Return value

number of concurrent threads supported. If the value is not well defined or not computable, returns 0.

[edit] Exceptions

noexcept specification:  
noexcept

  (C++11 feature)

[edit] Example