Running code with pthreads