scratch/threads: added a thread pool