On Apr 26, 2:38 pm, Paul Rubin <http://phr...@nospam.invalid> wrote:
> Carl Banks <pavlovevide...@gmail.com> writes:
> > Say you are running a thread and you want the power to be able to kill
> > it at any time.  The thread is either communicating with the rest of
> > the program periodically, or it isn't.  If it is, then there are ample
> > opportunities to tell the thread to terminate itself.  If it isn't,
> > then you might as well use a separate process which you can kill.
>
> That's not so satisfying.  If you use a separate process, it can't
> share Python objects with the main process,

Which is "communicating with the rest of the program periodically".

Presumably you have to protect objects to share them?  There you go:
anytime you try to acquire a lock have the thread check to see whether
to abort.


Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to