Re: Cancelling a python thread (revisited...)
- From: Antoine Pitrou <solipsis@xxxxxxxxxx>
- Date: Sun, 8 Nov 2009 13:52:17 +0000 (UTC)
Le Sun, 08 Nov 2009 04:40:26 -0800, sven a écrit :
I really don't get that. If the reason would be that it is too much
work to
implement, then I could accept it.
It would probably be a lot of work and even then it would still be unsafe.
Read for example:
http://msdn.microsoft.com/en-us/library/ms686717%28VS.85%29.aspx
« TerminateThread is a dangerous function that should only be used in the
most extreme cases. You should call TerminateThread only if you know
exactly what the target thread is doing, and you control all of the code
that the target thread could possibly be running at the time of the
termination. For example, TerminateThread can result in the following
problems:
* If the target thread owns a critical section, the critical section
will not be released.
* If the target thread is allocating memory from the heap, the heap
lock will not be released.
* If the target thread is executing certain kernel32 calls when it is
terminated, the kernel32 state for the thread's process could be
inconsistent.
* If the target thread is manipulating the global state of a shared
DLL, the state of the DLL could be destroyed, affecting other users of
the DLL. »
.
- Follow-Ups:
- Re: Cancelling a python thread (revisited...)
- From: John Nagle
- Re: Cancelling a python thread (revisited...)
- References:
- Cancelling a python thread (revisited...)
- From: Sven Marnach
- Re: Cancelling a python thread (revisited...)
- From: Carl Banks
- Re: Cancelling a python thread (revisited...)
- From: sven
- Cancelling a python thread (revisited...)
- Prev by Date: Re: Cancelling a python thread (revisited...)
- Next by Date: Query about doing fortran-esque repeat formatting
- Previous by thread: Re: Cancelling a python thread (revisited...)
- Next by thread: Re: Cancelling a python thread (revisited...)
- Index(es):
Relevant Pages
|