[issue11724] concurrent.futures: executor.submit() runs until completion even when future times out or is canceled

Antoine Pitrou report at bugs.python.org
Thu Mar 31 14:06:30 CEST 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

Agreed with Brian. There is generally no reliable way to terminate another thread or process without cooperation from said thread or process. Especially in the case of threads, terminating a thread while leaving the process alive may leave some resources (including Python interpreter resources) in a consistent state. Admittedly, terminating a process could be implemented using kill().

The solution is to write your long-running task so that it can be cancelled using a synchronization object (such as an Event).

----------
nosy: +pitrou
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11724>
_______________________________________


More information about the Python-bugs-list mailing list