File tree Expand file tree Collapse file tree 4 files changed +5
-27
lines changed
tests/StackExchange.Redis.Tests Expand file tree Collapse file tree 4 files changed +5
-27
lines changed Original file line number Diff line number Diff line change 1- using System . Diagnostics . CodeAnalysis ;
1+ using System . Diagnostics . CodeAnalysis ;
22
33namespace StackExchange . Redis ;
44
@@ -9,27 +9,11 @@ public partial class ConnectionMultiplexer
99 [ MemberNotNull ( nameof ( SocketManager ) ) ]
1010 private void OnCreateReaderWriter ( ConfigurationOptions configuration )
1111 {
12- SocketManager = configuration . SocketManager ?? GetDefaultSocketManager ( ) ;
12+ SocketManager = configuration . SocketManager ?? SocketManager . Shared ;
1313 }
1414
1515 private void OnCloseReaderWriter ( )
1616 {
1717 SocketManager = null ;
1818 }
19-
20- /// <summary>
21- /// .NET 6.0+ has changes to sync-over-async stalls in the .NET primary thread pool
22- /// If we're in that environment, by default remove the overhead of our own threadpool
23- /// This will eliminate some context-switching overhead and better-size threads on both large
24- /// and small environments, from 16 core machines to single core VMs where the default 10 threads
25- /// isn't an ideal situation.
26- /// </summary>
27- internal static SocketManager GetDefaultSocketManager ( )
28- {
29- #if NET6_0_OR_GREATER
30- return SocketManager . ThreadPool ;
31- #else
32- return SocketManager . Shared ;
33- #endif
34- }
3519}
Original file line number Diff line number Diff line change @@ -855,10 +855,6 @@ private void StartBacklogProcessor()
855855 {
856856 _backlogStatus = BacklogStatus . Activating ;
857857
858- #if NET6_0_OR_GREATER
859- // In .NET 6, use the thread pool stall semantics to our advantage and use a lighter-weight Task
860- Task . Run ( ProcessBacklogAsync ) ;
861- #else
862858 // Start the backlog processor; this is a bit unorthodox, as you would *expect* this to just
863859 // be Task.Run; that would work fine when healthy, but when we're falling on our face, it is
864860 // easy to get into a thread-pool-starvation "spiral of death" if we rely on the thread-pool
@@ -871,7 +867,6 @@ private void StartBacklogProcessor()
871867 Name = "StackExchange.Redis Backlog" , // help anyone looking at thread-dumps
872868 } ;
873869 thread . Start ( this ) ;
874- #endif
875870 }
876871 else
877872 {
Original file line number Diff line number Diff line change 22 <PropertyGroup >
33 <Nullable >enable</Nullable >
44 <!-- extend the default lib targets for the main lib; mostly because of "vectors" -->
5- <!-- Note: we're NOT building for .NET 6 because the thread pool changes are not wins yet -->
6- <TargetFrameworks >net461;netstandard2.0;net472;netcoreapp3.1;net5.0</TargetFrameworks >
5+ <TargetFrameworks >net461;netstandard2.0;net472;netcoreapp3.1;net5.0;net6.0</TargetFrameworks >
76 <Description >High performance Redis client, incorporating both synchronous and asynchronous usage.</Description >
87 <AssemblyName >StackExchange.Redis</AssemblyName >
98 <AssemblyTitle >StackExchange.Redis</AssemblyTitle >
3534 <AdditionalFiles Include =" PublicAPI/PublicAPI.Shipped.txt" />
3635 <AdditionalFiles Include =" PublicAPI/PublicAPI.Unshipped.txt" />
3736 <!-- APIs for netcoreapp3.1+ -->
38- <AdditionalFiles Include =" PublicAPI/netcoreapp3.1/PublicAPI.Shipped.txt" Condition =" '$(TargetFramework )' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0 '" />
37+ <AdditionalFiles Include =" PublicAPI/netcoreapp3.1/PublicAPI.Shipped.txt" Condition =" '$(TargetFrameworkIdentifier )' == '.NETCoreApp '" />
3938 </ItemGroup >
4039
4140 <ItemGroup >
Original file line number Diff line number Diff line change @@ -468,7 +468,7 @@ public void DefaultThreadPoolManagerIsDetected()
468468
469469 using var conn = ConnectionMultiplexer . Connect ( config ) ;
470470
471- Assert . Same ( ConnectionMultiplexer . GetDefaultSocketManager ( ) . Scheduler , conn . SocketManager ? . Scheduler ) ;
471+ Assert . Same ( SocketManager . Shared . Scheduler , conn . SocketManager ? . Scheduler ) ;
472472 }
473473
474474 [ Theory ]
You can’t perform that action at this time.
0 commit comments