Improve ArrayPool core affinity (dotnet/coreclr#8716)
authorJan Kotas <jkotas@microsoft.com>
Fri, 23 Dec 2016 18:19:52 +0000 (10:19 -0800)
committerGitHub <noreply@github.com>
Fri, 23 Dec 2016 18:19:52 +0000 (10:19 -0800)
commit6bd059660ff70153c53a2eb00598d9aa442cfcad
treea3e71a0cbfc8aff2ac15324d2174b4eb95bc886b
parent7ec778b10221f61923f7522155d4be8a5865ebe3
Improve ArrayPool core affinity (dotnet/coreclr#8716)

- Move the ExecutionId to non-generic type so that it can be shared by all ArrayPool instances.
- Add logic to refresh it periodically. It avoids pathological cases where the OS scheduler ends up reassigns the preferred cores and multiple active threads start competing over the same buckets.
- Removed flushing of ExecutionId on LockedStack lock contention since it was not very effective

Commit migrated from https://github.com/dotnet/coreclr/commit/281b93760c7c6a7e9059f9a5dc6a5c6cfc0e4879
src/coreclr/src/mscorlib/corefx/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.Unix.cs [deleted file]
src/coreclr/src/mscorlib/corefx/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.Windows.cs [deleted file]
src/coreclr/src/mscorlib/corefx/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.cs
src/coreclr/src/mscorlib/mscorlib.shared.sources.props
src/coreclr/src/mscorlib/src/System/Environment.cs