bpo-40390: Implement channel_send_wait for subinterpreters#19715
bpo-40390: Implement channel_send_wait for subinterpreters#19715benedwards14 wants to merge 4 commits into
Conversation
ericsnowcurrently
left a comment
There was a problem hiding this comment.
Thanks for working on this! Overall the implementation seems good. I've left some comments on things to address.
Regarding the approach to providing a blocking "send()"... After having seen the block-in-the-function approach here, I still have reservations about it. There's a lot of value to keeping the "send" part separate from the "wait" part.
Here are some alternatives that offer that separation:
- return an acquired
threading.Lockwhich the receiving interpreter releases - return a
wait(timeout=None)function which the receiving interpreter will un-block - caller passes in an acquired lock that the receiving interpreter releases
- caller passes in a callback function that the receiving interpreter triggers (via
_Py_AddPendingCall())
My preference is that first one (return a lock). Since we are crossing the interpreter boundary we need to be extra careful. A user-defined callback is too risky. Of the remaining options the first one is simplest and most consistent conceptually.
FWIW, I expect that most of the code in this PR should still work mostly as-is.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
|
FYI, there is a decent chance that we will make |
Sorry, something went wrong.
https://bugs.python.org/issue40390