How to write a multithreaded Pong game