MCPcopy Create free account
hub / github.com/dds-bridge/dds / get_cores

Method get_cores

library/src/system/system.cpp:409–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407
408
409int System::get_cores() const
410{
411 int cores = 0;
412#if defined(_WIN32) || defined(__CYGWIN__)
413 SYSTEM_INFO sysinfo;
414 GetSystemInfo(&sysinfo);
415 cores = static_cast<int>(sysinfo.dwNumberOfProcessors);
416#elif defined(__APPLE__) || defined(__linux__)
417 cores = sysconf(_SC_NPROCESSORS_ONLN);
418#endif
419
420 // TODO Think about thread::hardware_concurrency().
421 // This should be standard in C++11.
422
423 return cores;
424}
425
426
427string System::get_threading(int& thr) const

Callers 1

GetDDSInfoFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected