Setup threads.