Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-117657: Fix itertools.count thread safety #119267

Closed
wants to merge 1 commit into from
Closed

Commits on May 20, 2024

  1. Fix itertools.count in free-threading mode

    Thread safety in count_next. count_next has two modes. slow mode
    (obj->cnt set to PY_SSIZE_T_MAX), which now uses the object mutex
    (only if GIL is disabled) and fast mode, which is either simple
    cnt++  if GIL is enabled, or uses atomic_compare_exchange if
    GIL is disabled.
    Arnon Yaari committed May 20, 2024
    Configuration menu
    Copy the full SHA
    0813cc2 View commit details
    Browse the repository at this point in the history