calc default thread number for thread pool