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-116738: Use PyMutex for lzma module by yoney · Pull Request #140711 · python/cpython

Conversation

@yoney

@yoney yoney commented Oct 28, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Similar to #140555, the main goal was to review the lzma module for free-threading. The methods already use a lock, which makes them thread-safe in a free-threaded build. I replaced PyThread_acquire_lock with PyMutex. PyMutex releases the GIL when the thread is parked. This change removes some macros and allocation handling code.

cc: @mpage @colesbury @emmatyping

  • Issue: Audit all built-in modules for thread safety #116738

Sorry, something went wrong.

Uh oh!

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

All reactions
@yoney
pythongh-116738: Use PyMutex for lzma module
ef23321
@bedevere-app bedevere-app Bot mentioned this pull request Oct 28, 2025
Audit all built-in modules for thread safety #116738
Open
@yoney
yoney marked this pull request as ready for review October 28, 2025 16:39
@bedevere-app bedevere-app Bot added the awaiting review label Oct 28, 2025
ashm-dev
ashm-dev reviewed Oct 28, 2025
View reviewed changes
Comment thread Lib/test/test_free_threading/test_lzma.py Resolved

Uh oh!

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

ashm-dev
ashm-dev reviewed Oct 28, 2025
View reviewed changes
Comment thread Lib/test/test_free_threading/test_lzma.py Resolved

Uh oh!

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

ashm-dev
ashm-dev reviewed Oct 28, 2025
View reviewed changes
Comment thread Lib/test/test_free_threading/test_lzma.py Resolved

Uh oh!

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

@mpage
mpage requested review from colesbury, emmatyping and mpage October 28, 2025 20:21
@mpage mpage added the skip news label Oct 28, 2025
@kumaraditya303 kumaraditya303 added the topic-free-threading label Oct 29, 2025
kumaraditya303
kumaraditya303 reviewed Nov 6, 2025
View reviewed changes
Comment thread Lib/test/test_free_threading/test_lzma.py Resolved

Uh oh!

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

yoney and others added 2 commits November 7, 2025 08:44
@yoney
Use assertSetEqual
1acdbc9
@kumaraditya303
Merge branch 'main' into ft_lzma
92a8faa
kumaraditya303
kumaraditya303 approved these changes Nov 8, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Nov 8, 2025
@kumaraditya303 kumaraditya303 added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 8, 2025
@bedevere-bot

bedevere-bot commented Nov 8, 2025

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit 92a8faa 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F140711%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 8, 2025
@kumaraditya303
kumaraditya303 merged commit c13b592 into python:main Nov 11, 2025
123 of 124 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 11, 2025
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
@yoney @kumaraditya303 @StanFromIreland
pythongh-116738: use PyMutex in lzma module (python#140711)
472ccf4
Co-authored-by: Kumar Aditya <[email protected]>
@yoney yoney mentioned this pull request Dec 8, 2025
gh-116738: Make zlib module thread-safe #142432
Merged
@yoney yoney mentioned this pull request Dec 18, 2025
gh-116738: Make lzma module thread-safe #142947
Merged
@yoney
yoney deleted the ft_lzma branch January 27, 2026 17:07
@IvyXu420 IvyXu420 mentioned this pull request Jul 27, 2026
gh-154707: Replace PyThread_type_lock with PyMutex in bufferedio.c #154708
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ZeroIntensity ZeroIntensity ZeroIntensity left review comments
@kumaraditya303 kumaraditya303 kumaraditya303 approved these changes
@colesbury colesbury Awaiting requested review from colesbury
@emmatyping emmatyping Awaiting requested review from emmatyping
@mpage mpage Awaiting requested review from mpage
+1 more reviewer
@ashm-dev ashm-dev ashm-dev left review comments
Reviewers whose approvals may not affect merge requirements

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.

Uh oh!

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

6 participants

@yoney @bedevere-bot @ZeroIntensity @kumaraditya303 @ashm-dev @mpage
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.