Added support for specifying thread pool size