gh-115999: Add free-threaded specialization for SEND.#127426
gh-115999: Add free-threaded specialization for SEND.#127426nascheme merged 3 commits intopython:mainpython/cpython:mainfrom nascheme:gh-115999-specialize-sendnascheme/cpython:gh-115999-specialize-sendCopy head branch name to clipboard
SEND.#127426Conversation
No additional thread safety changes are required. Note that sending to a generator that is shared between threads is not safe in the free-threaded build.
|
Related: GH-126371 makes native generators thread safe for free-threading. Once this gets merged, I can finish that one up and add any needed locking for the specialization instruction. |
|
I didn't test too much but applying GH-126371 on top of this PR makes the |
corona10
left a comment
There was a problem hiding this comment.
I try to organize unitest codes for specialized opcodes with more understandable function name :)
See:
cpython/Lib/test/test_opcache.py
Lines 1400 to 1418 in c112de1
mpage
left a comment
There was a problem hiding this comment.
LGTM. I left a small suggestion inline to make the implementation of _Py_Specialize_Send a little more concise, but feel free to ignore it if you prefer the current code structure.
I've kicked off benchmark runs for both the default and free-threaded builds for this change. I'll post the results once they're available, likely tomorrow morning.
|
Performance looks neutral on both the default and free-threaded builds. I think it's still worth merging this to stay consistent with the default build. |
…h-127426) No additional thread safety changes are required. Note that sending to a generator that is shared between threads is currently not safe in the free-threaded build.
…h-127426) No additional thread safety changes are required. Note that sending to a generator that is shared between threads is currently not safe in the free-threaded build.
No additional thread safety changes are required. Note that sending to a generator that is shared between threads is not safe in the free-threaded build.
--disable-gilbuilds #115999