Kyle Stanley <aeros...@gmail.com> added the comment:

I now have a working implementation, for both ThreadPoolExecutor and 
ProcessPoolExecutor. I've also ensured that the tests I added are not 
vulnerable to race conditions with the following:

```
[aeros:~/repos/aeros-cpython]$ ./python -m test test_concurrent_futures --match 
test_cancel_futures -j200 -v -F

[snip]
Ran 4 tests in 2.865s

OK
0:03:24 load avg: 143.25 [1018] test_concurrent_futures passed -- running: 
test_concurrent_futures (2 min 36 sec), test_concurrent_futures (35.8 sec)
test_cancel_futures 
(test.test_concurrent_futures.ProcessPoolForkProcessPoolShutdownTest) ... 0.57s 
ok
test_cancel_futures 
(test.test_concurrent_futures.ProcessPoolForkserverProcessPoolShutdownTest) ... 
0.80s ok
test_cancel_futures 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolShutdownTest) ... 
0.53s ok
test_cancel_futures (test.test_concurrent_futures.ThreadPoolShutdownTest) ... 
0.20s ok
```

I'll attach a PR to the issue once I finish writing the documentation and 
"What's New" entry.

Note: I was originally going to do this in two separate PRs, one for each 
executor, but it seemed to make more sense to just have it as a single cohesive 
PR since Executor.shutdown() shares the same documentation for both executors.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39349>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to