如何识别负责跨核心上下文切换的线程,以及保持同步的线程?
(PS:我是 Visual Studio 的这一部分的新手……边学习边学习,感谢提示!)
花费最多时间同步的线程的各种堆栈跟踪,我不知道为什么:
线程 12384
Category = Synchronization Delay = 650947.5375 ms
ntoskrnl.exe!SwapContext_PatchXRstor ntoskrnl.exe!KiSwapContext
ntoskrnl.exe!KiCommitThreadWait ntoskrnl.exe!KeWaitForSingleObject
ntoskrnl.exe!NtWaitForSingleObject ntoskrnl.exe!KiSystemServiceCopyEnd
线程 8792
Category = Synchronization API = WaitForMultipleObjects
Delay = 8993.9801 ms Unblocked by thread 3052; click 'Unblocking
Stack' for details. kernel32.dll!_WaitForMultipleObjects@16
clr.dll!WKS::WaitForFinalizerEvent
clr.dll!WKS::GCHeap::FinalizerThreadWorker
clr.dll!Thread::DoExtraWorkForFinalizer
clr.dll!Thread::ShouldChangeAbortToUnload
clr.dll!Thread::ShouldChangeAbortToUnload
clr.dll!ManagedThreadBase_NoADTransition
clr.dll!ManagedThreadBase::FinalizerBase
clr.dll!WKS::GCHeap::FinalizerThreadStart
clr.dll!Thread::intermediateThreadProc
kernel32.dll!@BaseThreadInitThunk@12 ntdll.dll!___RtlUserThreadStart@8
ntdll.dll!__RtlUserThreadStart@8
The Unblocking stack for the above is
Thread 8792 was unblocked by thread 3052 The unblocking call stack
follows: ntoskrnl.exe! ?? ?? ::FNODOBFM::`string'
ntoskrnl.exe!NtSetEvent ntoskrnl.exe!KiSystemServiceCopyEnd
wow64cpu.dll!CpupSyscallStub wow64cpu.dll!Thunk0Arg
wow64.dll!RunCpuSimulation wow64.dll!Wow64LdrpInitialize ntdll.dll! ??
?? ::FNODOBFM::`string' ntdll.dll!LdrInitializeThunk
ntdll.dll!_ZwSetEvent@8 kernelbase.dll!_SetEvent@4
clr.dll!CLREvent::Set clr.dll!WKS::gc_heap::try_allocate_more_space
clr.dll!WKS::gc_heap::allocate_more_space clr.dll!WKS::GCHeap::Alloc
clr.dll!Alloc clr.dll!FastAllocatePrimitiveArray clr.dll!JIT_NewArr1
mscorlib.ni.dll![mscorlib.dll] mscorlib.ni.dll![mscorlib.dll]
mscorlib.ni.dll![mscorlib.dll] mscorlib.ni.dll![mscorlib.dll]
!0x206b89 system.core.ni.dll![<Unknown>]
system.core.ni.dll![<Unknown>] system.core.ni.dll![<Unknown>]