Re: [Python-checkins] CVS: python/nondist/peps pep-0042.txt,1.43,1.44

On Mon, 13 Nov 2000, Guido van Rossum wrote:
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. -- Moshe Zadka <moshez@math.huji.ac.il> -- 95855124 http://advogato.org/person/moshez

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/)

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/)
participants (2)
-
Guido van Rossum
-
Moshe Zadka