C++ Thread Library - Function hardware_concurrency



Description

It returns the number of hardware thread contexts.

Declaration

Following is the declaration for std::thread::native_handle function.

static unsigned hardware_concurrency() noexcept;

C++11

static unsigned hardware_concurrency() noexcept;

Parameters

none

Return Value

It returns the number of hardware thread contexts.

Exceptions

No-throw guarantee − never throws exceptions.

Data races

Unspecified.

thread.htm
Advertisements