(refactor) Use a taskpool to manage spawned threads.