In my application, I have run into an InvalidOperationException when I did try to re-assign the Thread.Name property. Looking at the doc, it says that this property is write-once. Can someone tell me why For me this constraint is just annoying (the workaround is easy but painfull).
Thanks in advance,
Joannes

Why is Thread.Name a write-once property?
DLilga
What if your current thread name has already been set by a library that you do not control What if this library systematically sets the thread name (for good or bad reason), why can't you change again the thread name
Also following the logic of this restriction, why not prevent Thread.Name to be set after Start() is called. In you want to simplify the life of the debugger, it would make much more sense IMO.
Nevertheless, I would greatly prefer to have the full liberty to set Thread.Name whenever I want (my responsability to make the debuggers life simple).
Joannes
Shadi_05
Dave
purpleton
hotwind
IMO, many reasonable designs are possible:
- Thread.Name is not writeable (name can be set through constructor only).
- Thread.Name is (freely) writeable before Thread.Start and not afterward.
- Thread.Name is writeable at any time.
Before of the situation described at the beginning of this post, I think that the current design of Thread.Name is hacky and does not even fits the purpose that you are evocating.Joannes