CPU count detecting to efficiently use available threads.