Frame-based multithreading framework using pthreads