Re: Cancelling a python thread (revisited...)
by Antoine Pitrou other posts by this author
Nov 8 2009 5:56AM messages near this date
Re: Cancelling a python thread (revisited...)
|
Re: Cancelling a python thread (revisited...)
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. »
--
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
|