Skip to content

Commit 44f468c

Browse files
committed
Use the ThreadPool from .NET instead of the shared pool
1 parent 579a889 commit 44f468c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Redis.Docker.Web/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Console.WriteLine($"Worker Threads = {workerThreads} - Completion Port Threads = {completionPortThreads}");
88

9-
//ThreadPool.SetMinThreads(500, completionPortThreads);
9+
ThreadPool.SetMinThreads(workerThreads * 10, completionPortThreads);
1010

1111
ThreadPool.GetMinThreads(out workerThreads, out completionPortThreads);
1212

Redis.Docker.Web/RedisClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class RedisClient
1111

1212
public RedisClient(string connectionString)
1313
{
14-
var connectionMultiplexer = ConnectionMultiplexer.Connect(connectionString);
14+
var connectionMultiplexer = ConnectionMultiplexer.Connect(connectionString, options => options.SocketManager = SocketManager.ThreadPool);
1515
_redisDatabase = connectionMultiplexer.GetDatabase();
1616
var multiplexers = new List<RedLockMultiplexer>
1717
{

0 commit comments

Comments
 (0)