Backlog: use a Task over Thread in .NET 6.0 by NickCraver · Pull Request #1950 · StackExchange/StackExchange.Redis
In #1854 we switched to a Thread here to prevent the pile-up case, however under concurrent load this incurs a 10-11% penalty given backlogs aren't all that uncommon (due to the lock contention case). In .NET 6.0+, let's use the thread pool growth semantics to handle the stall case and use the cheaper Task.Run() approach.
eerhardt added a commit to eerhardt/StackExchange.Redis that referenced this pull request
Jun 29, 2023This allows for using new APIs introduced in net6.0. In order to enable building for net6.0, we also need to revert the thread pool changes in StackExchange#1939 and StackExchange#1950. This was already effectively reverted in StackExchange#1992 by not building for net6.0. Now that we are building for net6.0 again, these if-defs need to be removed.
NickCraver pushed a commit that referenced this pull request
Jul 1, 2023This allows for using new APIs introduced in net6.0. In order to enable building for net6.0, we also need to revert the thread pool changes in #1939 and #1950. This was already effectively reverted in #1992 by not building for net6.0. Now that we are building for net6.0 again, these if-defs need to be removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters