Skip to content

gh-142518: Add thread safety notes for the buffer protocol#145911

Merged
lysnikolaou merged 4 commits intopython:mainfrom
lysnikolaou:buffer-protocol-thread-safety
Mar 18, 2026
Merged

gh-142518: Add thread safety notes for the buffer protocol#145911
lysnikolaou merged 4 commits intopython:mainfrom
lysnikolaou:buffer-protocol-thread-safety

Conversation

@lysnikolaou
Copy link
Member

@lysnikolaou lysnikolaou commented Mar 13, 2026


* The export counter decrement in step (1) must be atomic.

* Resource cleanup when the counter reaches zero must be reentrant,
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure why it needs to be re-entrant, can you give an example?

Copy link
Member Author

@lysnikolaou lysnikolaou Mar 17, 2026

Choose a reason for hiding this comment

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

What I meant here is that resource cleanup should only happen once. Or, in general, be handled gracefully. Should I update the wording you think?

Copy link
Contributor

@kumaraditya303 kumaraditya303 left a comment

Choose a reason for hiding this comment

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

One question otherwise LGTM

@lysnikolaou lysnikolaou added the needs backport to 3.14 bugs and security fixes label Mar 18, 2026
@lysnikolaou lysnikolaou merged commit 847f83e into python:main Mar 18, 2026
30 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Mar 18, 2026
@miss-islington-app
Copy link

Thanks @lysnikolaou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 18, 2026
…honGH-145911)

(cherry picked from commit 847f83e)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Mar 18, 2026

GH-146106 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Mar 18, 2026
lysnikolaou added a commit that referenced this pull request Mar 18, 2026
…-145911) (#146106)

(cherry picked from commit 847f83e)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news topic-free-threading

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants