init pthreads