Course project: Multithreading (Python) Thread daemon thread join() ThreadPoolExecutor race conditions synchronization deadlock producer-consumer