innominate227
innominate227

Reputation: 11703

CLR recognized threads

This page http://msdn.microsoft.com/en-us/library/zf749bat(v=vs.110).aspx talks about different thread numbers reported by the CLR: Physical, Logical, and Recognized.

Can someone explain what it means for a thread to be "recognized" by the CLR?

Why would cause my recognized threads to max out at 2, while both physical and logical threads are in the 30s?

Upvotes: 1

Views: 541

Answers (1)

Hans Passant
Hans Passant

Reputation: 942080

The CLR is not necessarily aware of all threads that run inside a process. It cannot know anything about threads that were started by native code with CreateThread(). A COM server or a native program that hosts the CLR are the common examples of that. There are many COM servers that are wrapped by .NET classes, System.DirectoryServices and System.Management for example.

It is forced to deal with them when such a thread makes a call into managed code, an event or a callback is the usual case. Because then it also needs to perform stack walks on that thread to find managed objects when it collects garbage or looks for CAS attributes.

At that point, this unknown native thread becomes a "recognized" thread. There's no special significance to seeing "2" for that value, anything goes.

Upvotes: 5

Related Questions