a initial implementation of thread pool