Creates a thread pool