Native threads in .Net application

When I released the command ~ * e! clrstack in WinDbg, to identify the call stack of clr threads in a console application, he listed 5 threads. 3 of them are managed threads (Main Thread, Thread that I packaged, Collection thread garbage (I expect)). 2 are native threads . I have not created any threads of my own.

What do these native threads do? Where can I get more information?

The output of the command ~ * e! clrstack is given below

0:004> ~* e !clrstack
OS Thread Id: 0x1ab8 (0)
ESP       EIP     
0012f3c0 7c90e514 [HelperMethodFrame: 0012f3c0] System.Threading.Thread.SleepInternal(Int32)
0012f414 79299275 System.Threading.Thread.Sleep(Int32)
0012f418 00c602bf testlock.LockTest.Test()
0012f458 00c60131 testlock.Program.Main(System.String[])
0012f69c 79e71b4c [GCFrame: 0012f69c] 
OS Thread Id: 0x1008 (1)
Unable to walk the managed stack. The current thread is likely not a 
managed thread. You can run !threads to get a list of managed threads in
the process
OS Thread Id: 0x209c (2)
Failed to start stack walk: 80004005
OS Thread Id: 0x1490 (3)
ESP       EIP     
00d6f74c 7c90e514 [GCFrame: 00d6f74c] 
00d6f81c 7c90e514 [HelperMethodFrame_1OBJ: 00d6f81c] System.Threading.Monitor.Enter(System.Object)
00d6f874 00c602b3 testlock.LockTest.Test()
00d6f8b4 00c6022c testlock.Program+<>c__DisplayClass1.<Main>b__0()
00d6f8c0 792d6d66 System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
00d6f8cc 792e01ef System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
00d6f8e4 792d6ce4 System.Threading.ThreadHelper.ThreadStart()
00d6fb0c 79e71b4c [GCFrame: 00d6fb0c] 
OS Thread Id: 0x1cb8 (4)
Unable to walk the managed stack. The current thread is likely not a 
managed thread. You can run !threads to get a list of managed threads in
the process
+5
source share
2 answers

When Windows starts your application, it installs several unmanaged threads. This is absolutely normal.

, :

.kb100
!dumpstack

dumpstack, .

,

!threads

, :

http://blogs.msdn.com/b/tess/archive/2005/12/20/things-to-ignore-when-debugging-an-asp-net-hang.aspx

+4

, ,

! -special

IOCompletion, Gate, DbgHelper, GC, Finalizer, Timer, ADUnloadHelper

clrstack = > ThreadpoolWorker

0

All Articles