1

I started receiving this exception in my application. I took a dump and here is how the threadpool looks like:

0:014> !threadpool
CPU utilization: 81%
Worker Thread: Total: 1000 Running: 4 Idle: 996 MaxLimit: 1000 MinLimit: 1000
Work Request in Queue: 0
--------------------------------------
Number of Timers: 1
--------------------------------------
Completion Port Thread:Total: 32 Free: 31 MaxFree: 8 CurrentLimit: 32 MaxLimit: 1000 MinLimit: 1000

Those 996 Idle threads have similar callstack which looks like:

ntdll!NtWaitForSingleObject+0x14
KERNELBASE!WaitForSingleObjectEx+0x8f
clr!CLRSemaphore::Wait+0x8a
clr!ThreadpoolMgr::UnfairSemaphore::Wait+0x115
clr!ThreadpoolMgr::WorkerThreadStart+0x28b
clr!Thread::intermediateThreadProc+0x86
kernel32!BaseThreadInitThunk+0x14
ntdll!RtlUserThreadStart+0x21

If all those idle threads are waiting for work to do, then why did I get the "Not enough free threads in the ThreadPool to complete the operation message" exception?

DBK
  • 403
  • 4
  • 13

0 Answers0