add threadpool support
add threadpool support