perfview icon indicating copy to clipboard operation
perfview copied to clipboard

What is reason 8 for ThreadPoolWorkerThreadAdjustmentAdjustment event?

Open xiaomi7732 opened this issue 3 years ago • 3 comments

EventPipe captured thread adjustment event with reason 8: image

According to this document, there are listed reasons from 0x00 to 0x07: https://docs.microsoft.com/en-us/dotnet/framework/performance/thread-pool-etw-events#threadpoolworkerthreadadjustmentadjustment

Do we know what does 0x08 means?

I also don't see an enum for the reason in the runtime repo:

Refer to this Runtime code Am I looking into the right place?

Thanks!

xiaomi7732 avatar Sep 07 '22 18:09 xiaomi7732

0x8 is CooperativeBlocking. This should be specific to .NET Core.

The parser has been updated with this value at https://github.com/microsoft/perfview/blob/main/src/TraceEvent/Parsers/ClrTraceEventParser.cs#L12873.

brianrob avatar Sep 07 '22 19:09 brianrob

Hey @brianrob Thanks for the quick turn-around. What does CooperativeBlocking mean? Do you have any documentation to help understand it? It will also be great if there's any documentation to explain other reasons in the enum too. Thanks!

xiaomi7732 avatar Sep 07 '22 20:09 xiaomi7732

CooperativeBlocking is a behavior that allows the threadpool to detect behavior that looks like sync-over-async and increase the rate of thread injection to avoid thread starvation.

brianrob avatar Sep 07 '22 21:09 brianrob

Makes sense. Thanks for the info.

xiaomi7732 avatar Sep 27 '22 03:09 xiaomi7732