I'm currently trying to see what's happening with a thread, I've created in a C# application. The thread is of type System.Threading.Thread
and is embedded inside an internal object (and I have access to the thread inside that object while debugging).
I'm checking the application, using "Process Explorer".
Process Explorer has a "Threads" tab with columns "TID", "CPU", "Cycles Delta", "Suspend Count" and "Start Address".
In order to identify the thread I've started (in the debugger), I believe I can look for either the TID (Thread ID) or the start address, where I believe the thread ID to be the clearest.
However, at first sight I don't see any property/field/attribute in the System.Threading.Thread
class which looks like a thread ID.
Does anybody know which attribute/property/field of System.Threading.Thread
corresponds with Process Explorer's TID column?
Edit: there seems to be a ManagedThreadId
but that's not it.
Essentially, Managed Threads are not Native Threads, looking for a correlation in Task Manager will not be suitable. For more information see CLR Threading Overview - Managed vs. Native Threads
However, if you are using Visual studio you can use the Thread Window to debug managed threads.
View threads in the Visual Studio debugger by using the Threads window (C#, Visual Basic, C++)
Walkthrough: Debug a multithreaded app using the Threads window (C#, Visual Basic, C++