Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-123471: Make concurrent iteration over itertools.accumulate thread-safe#144486

Open
eendebakpt wants to merge 4 commits intopython:mainfrom
eendebakpt:accumulate_ft_v2
Open

gh-123471: Make concurrent iteration over itertools.accumulate thread-safe#144486
eendebakpt wants to merge 4 commits intopython:mainfrom
eendebakpt:accumulate_ft_v2

Conversation

@eendebakpt
Copy link
Contributor

@eendebakpteendebakpt commentedFeb 4, 2026
edited by bedevere-appbot
Loading

We use a critical section similar to the approach in#132814.

Note: theaccumulate has mutable internal statelz->initial andlz->total. With some refactoring we can replace thelz->init pointer with a C int (where atomics can be used), but thelz->total remains a pointer that is mutated on each iteration.

A side benefit of the refactoring would be that a decref inaccumulate_dealloc is avoided and visit inaccumulate_traverse. I decided not to include the refactoring in this PR (it would involve some churn), but if a core dev feels otherwise I will include it.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@rhettingerrhettingerAwaiting requested review from rhettingerrhettinger is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@eendebakpt

[8]ページ先頭

©2009-2026 Movatter.jp