Add thread pool.

Signed-off-by: Serg Brych <sbrych@gmail.com>