Questions on Threading

j.c.sackett j.c.sackett at gmail.com
Mon Jun 26 10:25:17 EDT 2006


Hello--

I'm using the threading module to accomplish some distributed processing on
a project, and have a basic (I hope) question that I can't find an answer to
elsewhere.

I've noted that there's a lot of documentation saying that there is no
external way to stop a thread, and yet when creating a thread through the
threading module I can see that it has a method called _Thread__stop, which
does indeed stop it. Is this in any way dangerous (i.e. doesn't actually
stop the thread, or causes other thread timing issues down the road?) Or is
there some other reason that there is officially no stop method?

The code would be basically:

t = threading.Thread(None, some_function)
t.start()
#Let t run for a while
t._Thread__stop()

Is this dangerous to a system using several many threads (100 max)?

Thanks,
J.C.Sackett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060626/6faa0d32/attachment.html>


More information about the Python-list mailing list