ThreadPool solution implemented.