interpreter limits

Paul Rubin http
Tue Apr 13 15:38:50 EDT 2004


Irmen de Jong <irmen at -nospam-remove-this-xs4all.nl> writes:
> Can't you do something smart with signals, threads, alarm() and kill() ?
> Like running the code in a worker thread, where the main thread
> keeps track of how long it has been running and if not finished
> within a certain time, kill() it.

How do you kill a thread from another thread?  I don't know of any way
to do that.

Maybe it's safest to run the user script in a separate process and
communicate through a socket or through shm.  That allows using the
normal OS features for resource limits, file protection, etc.



More information about the Python-list mailing list