Skip to content

gh-154283: Make threading.get_native_id() unique across processes on DragonFly#154287

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:dragonfly-native-id-unique
Jul 20, 2026
Merged

gh-154283: Make threading.get_native_id() unique across processes on DragonFly#154287
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:dragonfly-native-id-unique

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 20, 2026

Copy link
Copy Markdown
Member

On DragonFly BSD lwp_gettid() is only unique within a process (the main thread is always LWP 1), so threading.get_native_id() returned the same value in every process. Combine it with the process id, like Solaris (gh-137884) already does with thr_self().

…es on DragonFly

On DragonFly BSD lwp_gettid() is only unique within a process (the main
thread is always LWP 1), so combine it with the process id, like Solaris.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 20, 2026
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) July 20, 2026 18:44
@serhiy-storchaka
serhiy-storchaka merged commit 53597df into python:main Jul 20, 2026
62 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 53597df11e2d9f01ade2529c147df24b49685878 3.14

@bedevere-app

bedevere-app Bot commented Jul 20, 2026

Copy link
Copy Markdown

GH-154293 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 20, 2026
@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 53597df11e2d9f01ade2529c147df24b49685878 3.13

@bedevere-app

bedevere-app Bot commented Jul 20, 2026

Copy link
Copy Markdown

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

@bedevere-app

bedevere-app Bot commented Jul 20, 2026

Copy link
Copy Markdown

GH-154298 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 20, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 20, 2026
…ses on DragonFly (GH-154287) (GH-154298)

On DragonFly BSD lwp_gettid() is only unique within a process (the main
thread is always LWP 1), so combine it with the process id, like Solaris.
(cherry picked from commit 53597df)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
serhiy-storchaka added a commit that referenced this pull request Jul 20, 2026
…ses on DragonFly (GH-154287) (GH-154293)

On DragonFly BSD lwp_gettid() is only unique within a process (the main
thread is always LWP 1), so combine it with the process id, like Solaris.
(cherry picked from commit 53597df)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
serhiy-storchaka added a commit that referenced this pull request Jul 20, 2026
…ses on DragonFly (GH-154287) (GH-154297)

On DragonFly BSD lwp_gettid() is only unique within a process (the main
thread is always LWP 1), so combine it with the process id, like Solaris.
(cherry picked from commit 53597df)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant