Re: API for detection of multiple CPUs
From: David (thunderbolt01_at_netscape.net)
Date: 10/28/03
- Next message: robert: "Re: which linux for presario?"
- Previous message: Haedn Thorn: "Re: API for detection of multiple CPUs"
- In reply to: apm: "API for detection of multiple CPUs"
- Next in thread: apm: "Re: API for detection of multiple CPUs"
- Reply: apm: "Re: API for detection of multiple CPUs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 28 Oct 2003 14:31:39 GMT
apm wrote:
> Does anyone know if there is an API for detecting how many CPUs are
> present? I am after a way of programmatically determining whether or
> not a spinlock could be used in preference to a pthread mutex.
Possibly something like this?
if [ -x /usr/bin/getconf ]; then
CPUS=`getconf _NPROCESSORS_ONLN`
fi
if test "x$CPUS" = "x" -o "x$CPUS" = "x0"; then
CPUS=1
fi
-- Confucius: He who play in root, eventually kill tree. Registered with The Linux Counter. http://counter.li.org/ Slackware 9.1.0 Kernel 2.4.22 SMP i686 (GCC) 3.3.2 Uptime: 21 days, 20:23, 2 users, load average: 0.15, 0.09, 0.0
- Next message: robert: "Re: which linux for presario?"
- Previous message: Haedn Thorn: "Re: API for detection of multiple CPUs"
- In reply to: apm: "API for detection of multiple CPUs"
- Next in thread: apm: "Re: API for detection of multiple CPUs"
- Reply: apm: "Re: API for detection of multiple CPUs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|