Implement thread pool as a service.

Resolve #6