GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-112062: Make `_struct` module thread-safe in `--disable-gil` builds by chgnrdv · Pull Request #112094 · python/cpython

Conversation

@chgnrdv

@chgnrdv chgnrdv commented Nov 14, 2023 •
edited by colesbury
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes #112062

  • clear cache dict but preserve the reference in _clearcache_impl
  • create cache dict in _structmodule_exec
  • Issue: Make _struct module thread-safe in --disable-gil builds #112062

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chgnrdv
gh-112062: Make _struct module thread-safe in --disable-gil builds
bc2dac3
* use `PyDict_GetItemRef` instead of `PyDict_GetItemWithError` in `cache_struct_converter` to avoid usage of borrowed ref with explicit incref
* clear cache dict but preserve the reference in `_clearcache_impl`
* create cache dict in `_structmodule_exec`
@bedevere-app bedevere-app Bot added the awaiting review label Nov 14, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Nov 14, 2023
Make _struct module thread-safe in --disable-gil builds #112062
Closed
@colesbury colesbury added topic-free-threading skip news labels Nov 14, 2023
@colesbury

colesbury commented Nov 14, 2023

Copy link
Copy Markdown
Contributor

Thanks @chgnrdv. This is going to conflict with @serhiy-storchaka's #112076, which also makes _struct.c use PyDict_GetItemRef.

Maybe remove that part and just keep the changes to _clearcache_impl and _structmodule_exec?

chgnrdv reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chgnrdv
revert PyDict_GetItemWithError change in cache_struct_converter
4beec33
@colesbury
colesbury requested a review from kumaraditya303 November 15, 2023 00:27
colesbury
colesbury approved these changes Nov 15, 2023
View reviewed changes

@colesbury colesbury left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks, this lgtm. @kumaraditya303, would you please review this change?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Nov 15, 2023
kumaraditya303
kumaraditya303 approved these changes Nov 15, 2023
View reviewed changes

@kumaraditya303 kumaraditya303 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Nov 15, 2023
@kumaraditya303
kumaraditya303 merged commit 4744f59 into python:main Nov 15, 2023
@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 15, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@chgnrdv @aisk
pythongh-112062: Make _struct module thread-safe in --disable-gil…
06ceee9
… builds (python#112094)

* pythongh-112062: Make `_struct` module thread-safe in --disable-gil builds
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@chgnrdv @Glyphack
pythongh-112062: Make _struct module thread-safe in --disable-gil…
630ac12
… builds (python#112094)

* pythongh-112062: Make `_struct` module thread-safe in --disable-gil builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@colesbury colesbury colesbury approved these changes
@kumaraditya303 kumaraditya303 kumaraditya303 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news topic-free-threading

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Make _struct module thread-safe in --disable-gil builds

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@chgnrdv @colesbury @kumaraditya303
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.