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-111971: Make _PyUnicode_FromId thread-safe in --disable-gil #113489

Merged
merged 5 commits into from
Dec 26, 2023

Conversation

corona10
Copy link
Member

@corona10 corona10 commented Dec 26, 2023

@corona10
Copy link
Member Author

@colesbury

I am not sure that this implementation is what you intended at #111971 (comment).

  1. When _Py_Identifier is initial status(index==-1), the first thread that got mutex will get a proper index value for this.
  2. the rest of the threads will get PyObject * from the current index.

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

The _Py_static_string_init definition needs to be fixed, but otherwise looks okay

Include/cpython/object.h Outdated Show resolved Hide resolved
Include/cpython/object.h Show resolved Hide resolved
@corona10 corona10 enabled auto-merge (squash) December 26, 2023 16:24
@corona10 corona10 enabled auto-merge (squash) December 26, 2023 16:25
@corona10 corona10 merged commit 8f5b998 into python:main Dec 26, 2023
30 checks passed
@corona10 corona10 deleted the gh-111971 branch December 27, 2023 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants