I'm writing a multi threaded Python app that makes many TCP connections to servers. Each connection is done on a separate thread. Sometimes the thread hangs for a long time which I don't want. How can I get the thread to kill itself after some given time period? From the main thread how can I determine that the child thread killed itself?
If possible I would appreciate a snippet of code showing how to do this. Thanks.
Update The system is Ubuntu 9:10