FreeBSD Manual Pages
std::jthrea...concurrency(3) C++ Standard Libary std::jthrea...concurrency(3) NAME std::jthread::hardware_concurrency - std::jthread::hardware_concurrency Synopsis [[nodiscard]] static unsigned int hardware_concurrency() noexcept; (since C++20) Returns the number of concurrent threads supported by the implemen- tation. The value should be considered only a hint. Parameters (none) Return value Number of concurrent threads supported. If the value is not well de- fined or not computable, returns 0. Example // Run this code #include <iostream> #include <thread> int main() { unsigned int n = std::jthread::hardware_concurrency(); std::cout << n << " concurrent threads are supported.\n"; } Possible output: 4 concurrent threads are supported. See also hardware_destructive_interference_size min offset to avoid false sharing hardware_constructive_interference_size max offset to promote true sharing (C++17) (constant) http://cppreference.com 2022.07.31 std::jthrea...concurrency(3)
NAME | Synopsis | Parameters | Return value | Example | Possible output: | See also
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::jthread::hardware_concurrency&sektion=3&manpath=FreeBSD+Ports+15.0>
