From: Matthias K. <mk-...@gm...> - 2013-07-26 07:04:06
|
Am 25.07.2013 15:49, schrieb Larry McVoy: > Posix has sysconf(_SC_NPROCESSORS_CONF) and TWAPI has a way as well. You can query this information using the getconf utility, e.g. for Linux % exec getconf _NPROCESSORS_CONF 2 % exec getconf _NPROCESSORS_ONLN 2 But as you may recognize, this variable is by no means standardized. IIRC Solaris (or was it AIX?) doesn't respect it at all. You can, however, get the information on every Unix system, but the way is different to get it. In the past I used /proc/cpuinfo on Linux, kstat cpu_info on Solaris, but I cannot remember the details for AIX and HP-UX anymore. On Linux/s390x I used a piece of Assembler (STFL and STFLE calls), though. kind regards -- Matthias Kraft (They that can give up essential liberty to obtain a little temporary) (safety deserve neither liberty nor safety. -- Benjamin Franklin) |