FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-127081: add critical sections to `dbm` objects by duaneg · Pull Request #132749 · python/cpython · GitHub

Repository navigation

gh-127081: add critical sections to dbm objects - #132749

Merged
corona10 merged 3 commits into
python:mainfrom
duaneg:gh-127081-dbm
May 14, 2025
Merged

corona10 merged 3 commits into
python:mainfrom
duaneg:gh-127081-dbm

Conversation

duaneg commented Apr 20, 2025 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

The dbm_* functions are not thread-safe, naturally. Add critical sections to protect their use.

The dbm_* functions are not thread-safe, naturally. Add critical sections to
protect their use.
picnixz changed the title gh-127081: add critical sections to dbm objects gh-127081: add critical sections to dbm objects Apr 20, 2025

ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

In general, it's easier to add lock_held variations of functions instead of adding inline critical sections with goto. For example:

static int
dbm_something_lock_held(PyObject *self)
{
    /* ... */
}

static int
dbm_something(PyObject *self)
{
    int result;
    Py_BEGIN_CRITICAL_SECTION(self);
    result = dbm_something_lock_held(self);
    Py_END_CRITICAL_SECTION();
    return result;
}

Would you mind switching over to that pattern here?

duaneg commented Apr 20, 2025

Copy link
Copy Markdown
Contributor Author

In general, it's easier to add lock_held variations of functions instead of adding inline critical sections with goto.... Would you mind switching over to that pattern here?

For sure, that would be much more robust, thanks!

corona10 self-assigned this Apr 23, 2025

Copy link
Copy Markdown
Member

Sorry for the delay, I will review during the PyCon sprint.

ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM as well

Copy link
Copy Markdown
Member

Would you like to update clinic again?

Copy link
Copy Markdown
Member

Oh it's not relatede to dbms.

corona10 merged commit ffaeb3d into python:main May 14, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
kumaraditya303 added the needs backport to 3.14 bugs and security fixes label Oct 12, 2025

Copy link
Copy Markdown

Thanks @duaneg for the PR, and @corona10 for merging it 🌮🎉.. 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 Oct 12, 2025
)

(cherry picked from commit ffaeb3d)

Co-authored-by: Duane Griffin <duaneg@dghda.com>

bedevere-app Bot commented Oct 12, 2025

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 12, 2025
kumaraditya303 pushed a commit that referenced this pull request Oct 12, 2025
…139996)

gh-127081: add critical sections to `dbm` objects (gh-132749)
(cherry picked from commit ffaeb3d)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL