This change includes some semi-related refactoring of queues and channels.
(cherry picked from commit d0eedfa10e, gh-134440)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This is an implementation of InterpreterPoolExecutor that builds on ThreadPoolExecutor.
(Note that this is not tied to PEP 734, which is strictly about adding a new stdlib module.)
Possible future improvements:
* support passing a script for the initializer or to submit()
* support passing (most) arbitrary functions without pickling
* support passing closures
* optionally exec functions against __main__ instead of the their original module