Most likely, I missed something obvious, but the humor of me ...
I always like to name important threads in my applications, as it is useful when debugging / registering etc. If you request the name of the main thread through Thread.CurrentThread.Name when the program starts, you will return null . That way, I always guarantee that the first thing that happens is that the main thread (and any other related threads) is given a beautiful meaningful name for the future link.
I never thought about this until today, but when viewing the Threads window in Visual Studio (before assigning thread names, etc.), a special category is assigned to the "Main thread", as well as the name of the pseudo, which also reads "Main thread" ( but this is not the name of the actual thread).
From a management point of view, .NET does not reveal anything meaningful either on System.Threading.Thread or on System.Diagnostics.ProcessThread , which identifies the main thread of the application (at least I could see). I looked through the list of “Windows Processes and Thread Functions” and again I did not see anything obvious (maybe OpenThread?).
Curious, does anyone know how the Threads window assigns a special category to the main theme?
Chris baxter
source share