multithreading - Python: how can I get a thread to kill itself after a timeout? -


i'm writing multi threaded python app makes many tcp connections servers. each connection done on separate thread. thread hangs long time don't want. how can thread kill after given time period? main thread how can determine child thread killed itself?

if possible appreciate snippet of code showing how this. thanks.

update system ubuntu 9:10

short answer: make def run() end. so, if waiting data socket, timeout, if timeout occur break while should have, , thread killed.

you can check main thread if thread alive isalive() method.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -