Use hardware_concurrency()