Multiprocessing using pthreads in C++11