(refactor) Use a taskpool to manage spawned threads.
Merge pull request #204 from reem/feat/taskpool

(refactor) Use a taskpool to manage spawned threads.