I created a SO question about naming conventions for threads a while ago. The question was something like, "How should you name a thread?"
Looking back, a thread name only matters if you have to read a thread's name.
Can you provide real-world examples of when you've had to examine threads and discern between them, relying on their names? This is platform/framework agnostic.
How (in what environment), did you do this?
Put another way, in what scenarios have you had to solve a problem and had to examine threads by name, and how did you accomplish this?
When looking for connection leaks in java, it is sometimes useful to trace an object back to see which thread it was created by. In our case, it was the Finalizer thread. This led us to the conclusion that things were getting garbage collected, but not being Finalized fast enough. i.e. a bunch of stuff was waiting to be finalized, which was all done in one thread.
As a result, we learnt a lesson about not relying on Finalize.
This question is currently tagged with 'linux' for no apparent reason... anyway, if you're using Visual Studio, the thread name appears in the threads window in the debugger, so if you're debugging an app with tons of threads, the name makes it super-easy to find 'the thread you care about' in this window in the debugger.
In short, I just use it because it interacts nicely with the debugger tooling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With