-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-36084: add native thread ID (TID) to threading.Thread objects (V2) #13463
Conversation
…jects now have a tid property (kernel thread ID)
…c operation, since the functionality now supports Windows as well; cleaned up and clarified doc notes, updated version added number (3.8)
… ID functions depending on system type and functional availability; Threading module now returns `None` if the thread has not been started, or if the Native ID functionality does not exist for the current operating system.
…e on the target system.
Misc/NEWS.d/next/Core and Builtins/2019-02-22-23-03-20.bpo-36084.86Eh4X.rst
Outdated
Show resolved
Hide resolved
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be put in the comfy chair! |
Per @bedevere-bot – |
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
@vstinner please advise if there are any additional suggestions you have or changes that should be implemented before the merge. |
I expect the reason it broke AIX - is because AIX supports - for nearly 30 years is my guess (not known if it was already in AIX 3.X, but always in AIX 4.X).
The 'key' issue being that <pthread.h> needs to be first (or -D_THREAD_SAFE, which may be 'better' to ensure that all C-code is compiled "thread-safe" when using gcc. I normally use xlc_r, which sets _THREAD_SAFE - but I cannot assume that gcc (which is what the AIX bots currently use) are compiling everything "thread-safe". Anyway, moving forward - how can I best contribute some code specific to AIX. Never tried working "together" before. |
To be clear, in all the POSIX-based platforms that I’ve worked with to build this feature (notably excluding AIX, which I have zero experience with), Can you confirm whether or not AIX has the capability to return the integral ID, or whether the |
Looking at docs, I think this might be what we’re looking for: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.basetrf2/thread_self.htm I will look into this and see if it’d be easy to add for this PR. |
I'd recommend tackling AIX as a separate PR. |
Either way :) In that case, I think this is mostly good to go (pending review of course). |
I could continue to nitpick to death, but well, you addressed my main concern: not add the function/attribute on unsupported platforms, so I approve your change. Thanks for fixing it! |
This is the second version of PR #11993 (original reverted due to test failures on unsupported operating systems).
cc @vstinner @pitrou
From the original PR:
https://bugs.python.org/issue36084