Threads Primer: A Guide to Multithreaded Programming