in reply to Multiprocessor (SMP) system detection
If you use the amazing Inline module, a function to get the number of CPUs is as easy as
use Inline C => qq{
#include <unistd.h>
long nprocs() { return sysconf(_SC_NPROCESSORS_CONF); }
};
my $num_cpus = nprocs();
This get the number of CPUs configured; replace "CONF" with "ONLN" to get the number of CPUs on line.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Multiprocessor (SMP) system detection
by clintp (Curate) on Jun 25, 2001 at 18:06 UTC | |
|
Re: Re: Multiprocessor (SMP) system detection
by sierrathedog04 (Hermit) on Jun 25, 2001 at 18:39 UTC | |
by Abigail (Deacon) on Jun 25, 2001 at 19:19 UTC | |
by bikeNomad (Priest) on Jun 25, 2001 at 19:07 UTC |