ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: Cancelling a python thread (revisited...)
by Sven other posts by this author
Nov 8 2009 4:47AM messages near this date
Re: Cancelling a python thread (revisited...) | Re: Cancelling a python thread (revisited...)
On Nov 8, 4:27 am, Carl Banks <pavlovevide...@[...].com>  wrote:
>  It doesn't sound like the thread is communicating with the process
>  much.  Therefore:

There is quite a bit of communication -- the computation results are
visulized while they are generated.

>  1. Run the C code in a separate process, or
>  2. Create the thread from a C extension, maybe even straight from
>  ctypes, and kill it from C or ctypes.

The second option is a good idea.  Thanks a lot, Carl!

>  > And why on earth doesn't that cancel method exist? There *are* good
>  > reasons to cancel a thread, just google for "terminate a Python
>  > thread" for tons of examples.
> 
>  Arguing that there are good reasons to allow killing threads isn't
>  going to get you very far.  The language developers already know
>  killing a thread is useful, yet the disallowed it anyway.  The
>  drawbacks were judged too severe (it makes enforcing invariants pretty
>  much impossible).

I really don't get that.  If the reason would be that it is too much
work to
implement, then I could accept it.  But saying: We know it is useful,
but we
won't allow to do it, just does not seem reasonable.  Thread
cancellation
might be generally unsafe, but there are cases when it is safe.  It
should be
up to the user to decide it.  There are many things that do harm if
you don't
use them correctly, and of course it would be a bad idea to remove all
of
them from Python.

Well, I won't complain too much.  At least some volunteers created
that
great language and gave it away for free :)

Thanks again for your suggestion.

Cheers,
    Sven
-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Sven Marnach
Carl Banks
Antoine Pitrou
John Nagle
Sven
Antoine Pitrou
John Nagle
Antoine Pitrou
Sven
exarkun
John Nagle

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved