Updated with initial pthreads implementation.