thread pool implementaion 2