exec code with timeout?
Alex Martelli
aleax at aleax.it
Mon Sep 8 08:51:17 EDT 2003
More information about the Python-list mailing list
Mon Sep 8 08:51:17 EDT 2003
- Previous message (by thread): exec code with timeout?
- Next message (by thread): exec code with timeout?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
John J. Lee wrote: > Alex Martelli <aleax at aleax.it> writes: >> Graham Fawcett wrote: > [...] >> > Hmm... well, again I'd suggest the PyThreadState_SetAsyncExc function. >> > It shouldn't be that hard to wrap... I'd try it myself, but haven't >> > made it >> > to 2.3 yet. :( >> >> Nope -- the attacking script can easily use try/except to defeat attempts >> to kill it via PyThreadState_SetAsyncExc . The latter isn't meant for >> any "adversarial" situation, but just for potentially _buggy_ threads. > [...] > > Which is what the OP asked for, actually -- the users are trusted. I think you're right -- I had not understood the OP's specs correctly. In this case, the OP's application seems to be exactly THE typical use case for the new functionality (which has been kept in C only to avoid attracting _inappropriate_ use...). See my lightning talk at OSCON, slides at http://www.strakt.com/docs/os03_threads_interrupt.pdf , for a brief explanations of the how's & why and C source code to wrap the new call if you KNOW it's exactly what you need. Alex
- Previous message (by thread): exec code with timeout?
- Next message (by thread): exec code with timeout?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list