> On Mon, 13 Nov 2000, Guido van Rossum wrote: > > > + - Killing a thread from another thread. Or maybe sending a > > + signal. Or maybe raising an asynchronous exception. > > + > > + http://sourceforge.net/bugs/?func=detailbug&bug_id=121115&group_id=5470 > > In general, killing threads in considered a bad idea. It is usually much > better to design the application properly, and being aware that a thread > doing nothing is not that big a deal. Sorry. I agree 99% (see the referenced thread). But this keeps coming up as a feature request, so I figured that there should be *something* we could offer -- if only some support library calls to make implementing this common pattern smooth. For that 1%, I believe that raising an asynchronous exception takes away *most* of the objections against killing threads -- it gives the thread control over recovery, since exceptions are to be expected anyway. Also note that in a long-running server, losing a thread every once in a while means leaking a lot of memory! So (in that case) the application design cannot afford to just "park" unproductive threads forever -- it must contain a robust way of recovering their resources. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4