Skip to content
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

Document Threads.threadid(::Task) #55369

Merged
merged 3 commits into from
Aug 4, 2024

Conversation

JamesWrigley
Copy link
Contributor

This is quite handy to figure out which thread a task is running on, and I couldn't find another way to do it from outside the task.

@giordano giordano added domain:docs This change adds or pertains to documentation domain:multithreading Base.Threads and related functionality labels Aug 4, 2024
@nsajko
Copy link
Contributor

nsajko commented Aug 4, 2024

Add some warnings if you're gonna do this. Ref https://julialang.org/blog/2023/07/PSA-dont-use-threadid/

@nsajko
Copy link
Contributor

nsajko commented Aug 4, 2024

Actually, now I see a warning is already there. However now that the doc string is generalized, the warning notice should be generalized, too.

@JamesWrigley
Copy link
Contributor Author

Sure, generalized it in 4c8e298.

@giordano giordano merged commit f4d1381 into JuliaLang:master Aug 4, 2024
7 checks passed
@JamesWrigley JamesWrigley deleted the task-threadid branch August 4, 2024 23:07
lazarusA pushed a commit to lazarusA/julia that referenced this pull request Aug 17, 2024
This is quite handy to figure out which thread a task is running on, and
I couldn't find another way to do it from outside the task.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation domain:multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants