How to terminate the function that runs every n seconds

Marko Rauhamaa marko at pacujo.net
Thu Jan 15 15:15:37 CET 2015


Dennis Lee Bieber <wlfraed at ix.netcom.com>:

> On Thu, 15 Jan 2015 11:34:54 +0200, Marko Rauhamaa <marko at pacujo.net>
>>Alas, a thread can't check anything because it's blocked by I/O.
>
> 	My response to that then is: design the thread's I/O so that it
> is not blocking... On Linux, maybe a timed select(); Windows? short
> sleeps around a non-blocking check for available data... (if console
> I/O, msvcrt.kbhit(); otherwise may need some other library function to
> put a time-out on the I/O)

Ah, polling, the fig leaf that covers embarrassing design constraints
all over the world.


Marko



More information about the Python-list mailing list