added number of CPU check to maximize goroutine parallelism