Skip to content

Conversation

@ZeroIntensity
Copy link
Member

@ZeroIntensityZeroIntensity commented Nov 3, 2024

@corona10
Copy link
Member

cc @colesbury

@corona10
Copy link
Member

I will try to take a look at today :)

@ZeroIntensityZeroIntensity changed the title gh-126366: Lock generic iterables in list.__init__gh-126366: Make native generators thread safeNov 4, 2024
@ZeroIntensity
Copy link
MemberAuthor

Closing in favor of #120327

@Fidget-Spinner
Copy link
Member

Wait I closed my PR in favour of yours... 😆 @ZeroIntensity

@ZeroIntensity
Copy link
MemberAuthor

Ah! I'll reopen this and list you as a co-author if yours has merge conflicts.

@ZeroIntensityZeroIntensity removed the needs backport to 3.13 bugs and security fixes label Dec 24, 2024
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a warning:

Check warning on line 129 in Python/ceval_macros.h
‘gen_frame’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall approach LGTM. I'm feeling more confortable with more critical sections :-)

@colesbury
Copy link
Contributor

  • Let's avoid critical sections in bytecodes.c. It's too easy to make these kinds of mistakes where you exit out of a critical section without ending it.
  • I don't think the generator running thread safety should use critical sections. We should use something like an atomic-compare-exchange to mark it as running

@ZeroIntensityZeroIntensity marked this pull request as draft January 2, 2025 17:55
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ZeroIntensity@corona10@Fidget-Spinner@colesbury@vstinner