added simple connection pool for pthreads