is it safe to stop a thread?

Parzival Herzog parz at home.com
Wed May 23 15:39:27 EDT 2001


Dustin, (and I, and perhaps others) want not to have the OS kill some OS thread,
but a way to signal a python program running in a thread, e.g. raise an exception
handled by the subject thread, say "thread.alerted" that alerts that thread.
The thread can handle the exception in any way it wants, including to terminate itself.

What we don't want is the present requirement to insert polling code everywhere
it would be needed  to guarantee adequately prompt response to an asynchronous condition,
arising in another thread, since this really cannot be doen in general anyways.

I don't see what the platform OS issue with that would be, it seems to me to be
a Python interpreter issue. Several Modula-3 implementation do it in a machine
and OS independent way, and they don't even have the advantage of an interpreter
loop.

- Parzival


"Tim Peters" <tim.one at home.com> wrote in message news:mailman.990596972.23738.python-list at python.org...
> [Dustin Boswell]
> > ...
> > there should be some "safe" mechanism set up for threads to signal
> > each other.
>
> Since Python uses each platform's native notion of threads, it's restricted
> to what native platform threads support.  Python isn't an operating system.
> That is, Python doesn't *implement* threads.  Instead it wraps a portable API
> *around* platform threads.  It's unusual to see reliable ways for one thread
> to kill another; even Java (eventually) gave up on that.
>






More information about the Python-list mailing list