set_threads function

Set the Number of Threads