Add support for pools of threads