GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — gh-117657: Fix itertools.count thread safety by wiggin15 · Pull Request #119268 · python/cpython Conversation
|
|
Can you arrange the In general, we don't want to damage the traditional build if we don't have to. Also, we would like maintainers to be able to easily look at the GIL path to understand what the function does and how it works. After the PR, I personally find it challenging to just read this code that used to be simple and obvious. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wiggin15 for fixing this. The logic looks correct to me.
I've left some suggestions inline in addition to Raymond's comment above.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Just to be clear, are you suggesting to bring back the original code under an ifdef, like so? #ifdnef Py_GIL_DISABLED // the original 3 lines, unmodified #else // free-threading code only #endif ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
+1 That would be a simple and reasonable way to preserve readability, maintainability, and performance. It would also make clear exactly what the no-gil code should be doing. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you @colesbury and @rhettinger for the constructive feedback. I pushed a revised commit. Please share your comments. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The path for the traditional build seems fine to me. The no-gil path is much more readable than before but I'm not expert enough to sign-off on that path. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Oops, forgot to backport this to 3.13 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @wiggin15 and @DinoV, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…19268) Fix itertools.count in free-threading mode (cherry picked from commit 87939bd) Co-authored-by: Arnon Yaari <[email protected]>
|
GH-120007 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
) Fix itertools.count in free-threading mode (cherry picked from commit 87939bd) Co-authored-by: Arnon Yaari <[email protected]>
Fix itertools.count in free-threading mode
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.