GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::thread::hardware_concurrency(3) C++ Standard Libary std::thread::hardware_concurrency(3)

std::thread::hardware_concurrency - std::thread::hardware_concurrency


static unsigned int hardware_concurrency() noexcept; (since C++11)


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


(none)


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

// Run this code


#include <iostream>
#include <thread>


int main() {
unsigned int n = std::thread::hardware_concurrency();
std::cout << n << " concurrent threads are supported.\n";
}


4 concurrent threads are supported.


hardware_destructive_interference_size min offset to avoid false sharing
hardware_constructive_interference_size max offset to promote true sharing
(C++17) (constant)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.