25 May
2006
25 May
'06
5:14 p.m.
Brian Brinegar wrote at 2006-5-25 10:49 -0400:
... What I would like is some sort of timeout for requests
This is very difficult: There is no safe way to abort a thread without its help -- an the thread might be in a condition where it does not recognize that its help is needed (e.g. it is waiting in a C extension). With version 2.3, Python grew a C-level (!) API function which sends an exception to a thread. In case, the thread is executing Python code, this exception may abort the thread (cleaning us as usually). However, when the thread executes C code, the exception is not seen until it reenters the Python interpreter. Therfore, this is only a partial solution... -- Dieter