message-io icon indicating copy to clipboard operation
message-io copied to clipboard

Modify thread name

Open jbabyhacker opened this issue 3 years ago • 3 comments

I would like the ability to provide an alternate thread name for the threads in for_each() and for_each_async(). If this is a change you are open to incorporating, I can make the change and put up a PR. Any interest?

jbabyhacker avatar Feb 08 '22 20:02 jbabyhacker

Hi!

I'm open to it :)

How will you enable this functionality without touching the API?

I see some approaches to configure the thread names:

  • compilation variable.
  • environment variable.
  • static variable you set before starting anything message-io related (maybe the most versatile).

lemunozm avatar Feb 08 '22 20:02 lemunozm

I was wondering how to do it as well. I think the static variable approach you mentioned would be the best approach.

jbabyhacker avatar Feb 08 '22 20:02 jbabyhacker

As a suggestion, the crate https://github.com/matklad/once_cell could be usefull

lemunozm avatar Feb 08 '22 20:02 lemunozm