[Tutor] Cancelling a thread or blocked read

Rikard Bosnjakovic rikard.bosnjakovic at gmail.com
Sat Mar 31 15:15:45 CEST 2007


On 3/31/07, Dhiraj Sharma <dhirajsharma at optonline.net> wrote:

> 2. Also, is it possible to cancel (abort) a blocking read (say, to stdin) in
> a function that can be called by a timer? The goal is to cancel the read if
> input is not forthcoming within a specified time.

For Windows, no idea. For Unix I'd use the signal-module and setup a
SIGALRM-handler.

http://docs.python.org/lib/module-signal.html

-- 
- Rikard - http://bos.hack.org/cv/


More information about the Tutor mailing list