Lisp mentality vs. Python mentality
Carl Banks
pavlovevidence at gmail.com
Sun Apr 26 17:55:54 EDT 2009
On Apr 26, 2:38 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> Carl Banks <pavlovevide... at 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
More information about the Python-list
mailing list