Lisp mentality vs. Python mentality
Scott David Daniels
Scott.Daniels at Acm.Org
Sun Apr 26 18:05:06 EDT 2009
Paul Rubin wrote:
> Carl Banks <pavlovevidence 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, isn't under the same
> memory management, etc.
But precisely because of that sharing the thread may be in the middle
something that "must complete" -- no with-statement locking will get
unlocked, no "finally:" clauses in code in the standard library, no
... -- there is just too much that goes wrong when a thread is
infinitely starved (which, in effect, is what would happen if you
could kill it).
--Scott David Daniels
Scott.Daniels at Acm.Org
More information about the Python-list
mailing list