Skip to content

No std ThreadId#6056

Open
Person-93 wants to merge 7 commits into
PyO3:mainfrom
Person-93:no_std_thread_id
Open

No std ThreadId#6056
Person-93 wants to merge 7 commits into
PyO3:mainfrom
Person-93:no_std_thread_id

Conversation

@Person-93

Copy link
Copy Markdown
Contributor

Re-implement ThreadId using PyThread_get_thread_ident. This makes is usable in no_std context.

@clin1234 clin1234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@davidhewitt davidhewitt 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.

Thanks, one comment on the FFI definition (see below).

Do you expect that the test suite (which does a lot of thread spawning) will need to change?

Comment thread pyo3-ffi/src/pythread.rs Outdated
@Person-93

Copy link
Copy Markdown
Contributor Author

Do you expect that the test suite (which does a lot of thread spawning) will need to change?

I don't think it will need to change, but it might be worth enabling it for wasm build and pulling in one of the wasm threading crates as a dev dependency.

@Person-93 Person-93 requested a review from davidhewitt May 22, 2026 16:37
Comment thread pyo3-ffi/src/pythread.rs Outdated
@Person-93 Person-93 requested a review from davidhewitt June 4, 2026 15:31

@davidhewitt davidhewitt 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.

Thanks

@davidhewitt davidhewitt added this pull request to the merge queue Jun 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 4, 2026
Comment thread pyo3-ffi/src/pythread.rs
@davidhewitt davidhewitt enabled auto-merge June 9, 2026 08:41
@davidhewitt davidhewitt added this pull request to the merge queue Jun 9, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jun 9, 2026
@codspeed-hq

codspeed-hq Bot commented Jun 11, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 12.96%

⚡ 1 improved benchmark
✅ 125 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
critical_section_creation 762.5 ns 675 ns +12.96%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing Person-93:no_std_thread_id (def302d) with main (cd128ed)

Open in CodSpeed

@clin1234

Copy link
Copy Markdown
Contributor

@codspeedbot explain why this is faster

@davidhewitt davidhewitt added this pull request to the merge queue Jun 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants