adding ability to tune the minimum number of threads