threads killing other threads
dsh8290 at rit.edu
Thu Feb 7 22:01:27 CET 2002
On Thu, Feb 07, 2002 at 12:17:26PM -0800, Jeff Shannon wrote:
| Greg Weeks wrote:
| > I've occasionally wanted thread objects to have an exit() method, so that
| > one thread could interrrupt and kill another. This doesn't seem to be
| > available, perhaps because POSIX threads don't support it.
| > Is that correct?
| > Is there some reason why threads killing threads would be undesirable or
| > hard to implement?
| I don't know the reasoning behind threads being unkillable (from outside),
Here's an analogy :
If someone is sitting on the toilet, then you come and kill him, how
is he supposed to flush?
Processes can be killed by other processes since their resources are
separate and the kernel can "flush" for the now-dead process. With
threads, there is one process and all resources are shared. No one is
left around to "flush".
He who spares the rod hates his son,
but he who loves him is careful to discipline him.
More information about the Python-list