Set threads.