I actually specifically want to be able to tell how many cores there are in total from all cpu units, and to use that number to create only that many threads - I appreciate your comments (various) about how the o/s will split things up for you and why what I want to do is irrelevant but I still want to be able to get a core count and launch that many threads - it's part of my design for a distributed computing system. It's not really worthwhile for me to just create threads on the offchance that they might end up on another core.
Thanks all for posting initial code for finding the core count.
Thanks all for posting initial code for finding the core count.