A threadpool implemented by python