-
Notifications
You must be signed in to change notification settings - Fork 639
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
Set posix thread name #3657
Set posix thread name #3657
Conversation
if you want to name internal threads, i guess it would be more useful and flexible to make the thread functions set their names by themselves. |
What I'm seeing right now is that all the WAMR threads inherit the name of the thread they were spawned from. This is confusing when debugging, so my goal with this change is to avoid that specific confusion. Do we want to do more than that? I see WAMR using threads for the public |
@bnason-nf seems that you are setting the thread name for debug purpose, how about wrapping the code with BH_DEBUG macro? #if BH_DEBUG != 0
#if defined __APPLE__
pthread_setname_np("wamr");
#else
pthread_setname_np(pthread_self(), "wamr");
#endif
#endif @yamt how do you think? |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
yes. |
i have no opinion on whether it should be conditional on BH_DEBUG or not. |
OK, maybe we can merge this PR to meet the debug requirement first and then add a public API to set the thread name in the future? @bnason-nf what's your opinion? |
That sounds fine to me. |
No description provided.