Replace Semaphore with ThreadPool

Signed-off-by: Edward Zhang <zhuadl@cn.ibm.com>