MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / hardware_concurrency

Method hardware_concurrency

src/tinythread/tinythread.cpp:263–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263unsigned thread::hardware_concurrency()
264{
265#if defined(_TTHREAD_WIN32_)
266 SYSTEM_INFO si;
267 GetSystemInfo(&si);
268 return (int) si.dwNumberOfProcessors;
269#elif defined(_SC_NPROCESSORS_ONLN)
270 return (int) sysconf(_SC_NPROCESSORS_ONLN);
271#elif defined(_SC_NPROC_ONLN)
272 return (int) sysconf(_SC_NPROC_ONLN);
273#else
274 // The standard requires this function to return zero if the number of
275 // hardware cores could not be determined.
276 return 0;
277#endif
278}
279
280
281//------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected