Make `ThreadPoolExecutor` propagate context at `submit()` time
Discussions on Python.org
Make `ThreadPoolExecutor` propagate context at `submit()` time
I’ve been thinking about the proposal in Enabling thread_inherit_context and context_aware_warnings by default on both builds - #30 by ngoldbaum today with an AI model’s help. As they’re wont to do, it pointed out a related issue in ThreadPoolExecutor that I think we should fix. The problem ThreadPoolExecutor spawns workers lazily from inside submit(), and work items run directly in the worker’s ambient thread context. With thread_inherit_context=1 (the free-threaded default), a spawned thread...
0 comments
No comments yet.