if no max thread count is given, set it to the number of cores