timers in threaded application

Skip Montanaro skip.montanaro at gmail.com
Fri Jan 13 10:41:38 EST 2017

On Fri, Jan 13, 2017 at 3:23 AM, dieter <dieter at handshake.de> wrote:

> If what you want to timeout are not I/O operations, you can have a
> look at "threading.Timer". It uses a separate thread, lets it wait
> a specified time and then starts a specified function, unless
> "cancel"ed.

Ooh, hadn't considered that. That would seem to do the trick. I assume the
function to be executed will be run in the timer's thread, so will have to
suitably lock any shared data.



More information about the Python-list mailing list