When server GC is ignored?

2019-08-08 15:38发布

问题:

I found this in the MSDN article about .NET 4 GC : http://msdn.microsoft.com/en-us/library/ee787088.aspx

"Workstation garbage collection is always used on a computer that has only one processor, regardless of the setting. If you specify server garbage collection, the CLR uses workstation garbage collection with concurrency disabled."

I would think that they mean one physical CPU. However I run my app in server GC mode (or at least I thought I did) on a server with one CPU but 8 HT logical processors...

The following code outputs 'true'

        System.Runtime.GCSettings.IsServerGC

So I dont get it - either the following code prints incorrect information or they meant one single core CPU without HT...

Anyone could explain it definitely?

回答1:

it seems the "one processor" refers to a single core no hyper-threading CPU.