simple httplib and urllib timeout question
Georg Mischler
schorsch at schorsch.com
Fri Apr 14 06:23:59 EDT 2000
phd at phd.russ.ru wrote:
> Georg Mischler wrote:
> > What exactly is your problem with signal.alarm() ?
>
> Python delivers alarm only when in Python VM. If the script is
> blocked in C (even worse - in system call), the signal will NOT be
> delivered.
> Of course, URL checker, while running through a big list of URLs,
> certainly spend most of the time in connect() and recv() system calls.
> This makes signals unusable.
This surprises me, because the snipped I posted is in everyday
use in something very similar to a link checker, and it works
perfectly well there. Reading throught the Python docs on
signals again, I guess that the different behaviour might
be caused by the underlying OS implementation.
I use it on Linux (going to check on FreeBSD soon), and it looks
like Linux will interrupt system level IO calls when a signal
arrives for the process. What platform does it fail on for you?
-schorsch
--
Georg Mischler -- simulations developer -- schorsch at schorsch.com
+schorsch.com+ -- lighting design tools -- http://www.schorsch.com/
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list