Added thread pool implementation.