Killing a thread

Tim Peters tim_one at email.msn.com
Tue Jul 20 01:06:36 EDT 1999


[Donn Cave]
> Python's thread support is evolving.  As a previous followup points out,
> you shouldn't kill threads, and I guess that's fair enough - in terms
> of normal program design, one should look for other ways to manage
> threads.
>
> But in default of any alternative, I suspect sometimes we have to violate
> this commandment, and I think one of these days Python will provide the
> tools to do what you have to do, not just what you want to do.

It's unlikely Python will ever allow thread A to kill thread B, or even
suspend it.  Hygiene aside, not all native thread packages support this, and
Python's portable semantics can't be lower-level than the most restrictive
thread platform's.

Note too that Java-- which got to define every bit of its thread
semantics --eventually removed inter-thread carnage from the language.  For
them, allowing it simply proved to be such a bad idea in practice that it
was retroactively declared a design error.

not-every-tool-is-applicable-as-is-to-every-problem-ly y'rs  - tim






More information about the Python-list mailing list