Using thread pool instead of spawning lots of threads