Use the Queue module to pass functions/objects to worker threads. Or better yet, take a small timeout from your project to learn about the Twisted framework (http://www.twistedmatrix.com) you'll save yourself a lot of time. Many of the details you'll be struggling with (socket I/O + threads) are already solved in this framework.