threadPool to control number of threads. functional method keep the same as single thread