implementing a manager/wrapper for pthreads