how to set no. of threads