Discussion:
select distinct SocketDesignation from Win32_Processor
(too old to reply)
not_a_commie
2007-06-19 15:28:29 UTC
Permalink
I am trying to (in the least amount of CPU time possible) determine
the number of unique CPU sockets on the motherboard. I attempted to do
a "select SocketDesignation from Win32_Processor group by
SocketDesignation" but this still returns a row for every CPU core.
Creating instances of each CPU and looping through their properties
and building up my own unique list of ["SocketDesignation"].Value does
work -- but it takes two freakin seconds! Is the Value member not the
same value used in the query? Or is the SocketDesignation data changed
by creating a CPU instance? Why does the group by not work in this
case? All I care about is the number of unique sockets on the
motherboard. O, and yes, the distinct keyword throws an exception for
invalid syntax.

Thanks,
Brannon
Sean McCoy
2010-12-07 20:09:25 UTC
Permalink
The NumberOfProcessors property on Win32_ComputerSystem will give the number of sockets (as opposed to the NumberOfLogicalProcessors).
Post by not_a_commie
I am trying to (in the least amount of CPU time possible) determine
the number of unique CPU sockets on the motherboard. I attempted to do
a "select SocketDesignation from Win32_Processor group by
SocketDesignation" but this still returns a row for every CPU core.
Creating instances of each CPU and looping through their properties
and building up my own unique list of ["SocketDesignation"].Value does
work -- but it takes two freakin seconds! Is the Value member not the
same value used in the query? Or is the SocketDesignation data changed
by creating a CPU instance? Why does the group by not work in this
case? All I care about is the number of unique sockets on the
motherboard. O, and yes, the distinct keyword throws an exception for
invalid syntax.
Thanks,
Brannon
Submitted via EggHeadCafe
Microsoft ASP.NET For Beginners
http://www.eggheadcafe.com/training-topic-area/ASP-NET/7/ASP.aspx
Loading...