> The only way I could see this to work as intended without making any changes to threading would be to optionally use daemon threads and avoid joining the threads in `executor.shutdown()` if `wait_at_exit` is set to False in the constructor for the executor.
Agreed, and that is precisely what I suggested in my previous comment. The attached PR already deals with the executor-specific part of the wait, but it would be straightforward to have it also affect the executor to create daemon threads, and the flag moved to the constructor.
> IMO, it also would require some fairly extensive testing to make sure it works as intended, which the patch currently lacks.
It is quite easy to check that a hanging thread (emulated by a simple sleep) is not joined by the executor with the appropriate flag set. |