Fix incorrect thread affinitization (dotnet/coreclr#24045)
authorJan Vorlicek <janvorli@microsoft.com>
Wed, 17 Apr 2019 03:11:35 +0000 (05:11 +0200)
committerJan Kotas <jkotas@microsoft.com>
Wed, 17 Apr 2019 03:11:35 +0000 (20:11 -0700)
commit8915091e748c3ee94b765caedfbcf9c955fbb700
tree95ab140255bb08dcf291541e4d1e0129f21bc785
parenta272b20666f94c6dd4cac3f9491d5bb58daccf49
Fix incorrect thread affinitization (dotnet/coreclr#24045)

The PAL_SetCurrentThreadAffinity was incorrectly adding the specified processor
to the current thread affinity set instead of setting the affinity to only
the processor specified.
It was causing significant performance hit in aspnet benchmarks on machines with
many cores.
This change crept in when I was refactoring the related code while removing
CPU groups emulation.

Commit migrated from https://github.com/dotnet/coreclr/commit/2a6ca5c3eb8f5597be776aea85fb4086a53ac0ad
src/coreclr/src/pal/src/thread/thread.cpp