Re: another try: "timout actions"
From: Diez B. Roggisch (deetsNOSPAM_at_web.de)
Date: 10/29/04
- Next message: Alex Martelli: "Re: C API q"
- Previous message: Peter Hansen: "Python package anthologies (was Re: ctypes 0.9.2 released)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 29 Oct 2004 15:42:50 +0200
> So, what other ways are there to code actions of the type described
> above? Which way would be the cleanest and most straightforward? (I
> don't want to use a program call, because this would decrease
> readability, portability and other good properties a lot.)
The only thing I can think of is to delegate the work to a therad, and wait
the specified period of time. If by then the result is computed, use it.
Otherwise continue - and ignore the thread. I admit that that is a ugly
solution - especially when the computation is time intensive.
Maybe some gurus can elaborate on why the regexp-search isn't interrupted by
the signal - the only thing I can think of is that the signal is deferred
until the interpreter re-enters its bytecode-loop - but why the search is
so atomic I don't know.
-- Regards, Diez B. Roggisch
- Next message: Alex Martelli: "Re: C API q"
- Previous message: Peter Hansen: "Python package anthologies (was Re: ctypes 0.9.2 released)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]