Detecting the number of processors with Ruby
July 11th, 2009
This post contains a cross platform Ruby method to return the total number of CPU cores. There are gems, such as facter, that will do the same thing and much more but if you just want a quick and dirty single purpose method this will probably suffice. The only tricky bit was picking the best way to do the determination in Windows. I ended up using a WMI approach described in Rick Minerich's There Counting Processors in .NET: The Pros and Cons of Five Different Methods post. Read the rest of this entry