python's threading has no "interrupt"?

Jane Austine janeaustine50 at hotmail.com
Tue Dec 2 08:06:34 CET 2003


janeaustine50 at hotmail.com (Jane Austine) wrote in message news:<ba1e306f.0311280611.54c88e78 at posting.google.com>...
> As far as I know python's threading module models after Java's.
> However, I can't find something equivalent to Java's interrupt and
> isInterrupted methods, along with InterruptedException.
> "somethread.interrupt()" will wake somethread up when it's in
> sleeping/waiting state.
> 
> Is there any way of doing this with python's thread? I suppose thread
> interrupt is a very primitive functionality for stopping a blocked
> thread.
> 
> Jane

Well, I haven't got any answer since I posted it. Meanwhile, I have
been searching for it myself. Something new has been added in 2.3 in
thread module. That's interrupt_main. But, unfortunately, it is the
opposite of what I expected; It interrupts the main thread.

After all this, I am a bit disappointed about Python. (it's sad)

Jane




More information about the Python-list mailing list