00001 // $Id: systeminfo.h,v 1.1 2009/12/06 13:43:05 dvermeir Exp $ 00002 #ifndef DV_THREAD_SYSTEMINFO_H 00003 #define DV_THREAD_SYSTEMINFO_H 00004 00005 #include <unistd.h> 00006 00007 namespace Dv { 00008 namespace Thread { 00009 /** A class to retrieve some system information. */ 00010 class SystemInfo { 00011 public: 00012 /** @return the number of currently available CPUs in the system */ 00013 static size_t number_of_cpus() { 00014 return sysconf(_SC_NPROCESSORS_ONLN); 00015 } 00016 }; 00017 } 00018 } 00019 #endif
dvthread-0.13.4 | [11 December, 2009] |