use the supplied number of threads

use the supplied number of threads