Question

I was asked this during an interview, and I wasn't able to come up with an answer.

The idea is to write a program using only the C standard library, and find out how many CPU cores the box has. The solution needs to be platform independent, and using external libraries or system calls is not allowed.

Does anybody have experience with this? Thanks!

Was it helpful?

Solution

Thanks everyone who participated. I think now it seems like the answer will be "there's no reliable way of doing this." Great discussions guys!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top