[threadpool] cache processor count (#17642)
commit0be756d6096e07bbd90350e6d5e5e536af031b53
authorBernhard Urban-Forster <lewurm@gmail.com>
Thu, 31 Oct 2019 21:08:14 +0000 (31 22:08 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 31 Oct 2019 21:08:14 +0000 (31 22:08 +0100)
treeb68d7e39a704623ca70450c801beaf6664d2b7a0
parentb484979aa9741673c2f820bdac7f5c925128ad9d
[threadpool] cache processor count (#17642)

On top of https://github.com/mono/corefx/pull/369 this improves the execution time of `System.Core-xunit` on Linux/ARM64 by 2x, so from:

```console
$ make -C mcs/class/System.Core run-xunit-test
[...]
=== TEST EXECUTION SUMMARY ===
   net_4_x_System.Core_xunit-test  Total: 48774, Errors: 0, Failed: 0, Skipped: 6, Time: 131.143s
```
to
```console
$ make -C mcs/class/System.Core run-xunit-test
[...]
=== TEST EXECUTION SUMMARY ===
   net_4_x_System.Core_xunit-test  Total: 48774, Errors: 0, Failed: 0, Skipped: 6, Time: 74.636s
```

This is only relevant for non-netcore. The CoreCLR folks just recently fixed something similar (thanks to Marek sharing this link): https://github.com/dotnet/coreclr/pull/27543
mcs/class/referencesource/mscorlib/system/threading/threadpool.cs