A multithreaded producer consumer example