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

Assign names to threads #618

Open
gavv opened this issue Oct 17, 2023 · 16 comments
Open

Assign names to threads #618

gavv opened this issue Oct 17, 2023 · 16 comments
Labels
easy hacks The solution is expected to be straightforward even if you are new to the project enhancement help wanted An important and awaited task but we have no human resources for it yet system Low-level system-specific stuff

Comments

@gavv
Copy link
Member

gavv commented Oct 17, 2023

pthread allows to assign names to threads, which is very handy for debugging. For example, gdb will display this names.

We always create threads using core::Thread class. We can do the following:

  • add new parameter const char * name to Thread constructor
  • pass name everywhere where we create threads (preferably in form "roc_xxx", e.g. "roc_network_loop", "roc_control_loop")
  • in Thread implementation, before calling run(), assign configured name to current thread

This SO answer gives an idea how to do it. Similar to Thread::get_tid, we should use ifdefs for different platforms.

@gavv gavv added enhancement help wanted An important and awaited task but we have no human resources for it yet easy hacks The solution is expected to be straightforward even if you are new to the project system Low-level system-specific stuff labels Oct 17, 2023
@8julie

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@8julie

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@8julie

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@8julie

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@8julie

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@8julie

This comment was marked as outdated.

@gavv gavv unassigned 8julie Feb 10, 2024
@dmklepp

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@gavv gavv added this to Roc Toolkit Jul 6, 2024
@gavv gavv moved this to Help wanted in Roc Toolkit Jul 6, 2024
@gavv
Copy link
Member Author

gavv commented Jul 12, 2024

Unassigning, so that someone could pick this up.

Here is the link to abandoned PR: #716

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy hacks The solution is expected to be straightforward even if you are new to the project enhancement help wanted An important and awaited task but we have no human resources for it yet system Low-level system-specific stuff
Projects
Status: Help wanted
Development

No branches or pull requests

3 participants