views:

217

answers:

2

Possible Duplicate:
Programmatically find the number of cores on a machine

I have a 3d game, and I am rebuilding its engine from scratch.

The new incarnation uses multi-threading to take advantage of multiple cores.

Does anyone know of a cross-platform(linux/win/mac) solution for querying the number of available cores?

A: 

Stackoverflow Archive:

Jonathan Sampson
Thank you, will implement!
AnalyticaL
A: 

If you're already using some API and/or library, it might have a solution. If not, you're left to coming up with something yourself.

C++ itself doesn't expose the concept of cores, so there is nothing in the language itself to help you. I don't think the standard libraries support such a check either.

unwind