三刀 преди 2 години
родител
ревизия
0000347780
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java

+ 1 - 1
frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java

@@ -29,7 +29,7 @@ public class Bootstrap {
     static byte[] body = "Hello, World!".getBytes();
 
     public static void main(String[] args) {
-        ExecutorService executorService = new ThreadPoolExecutor(1, 1,
+        ExecutorService executorService = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), Runtime.getRuntime().availableProcessors(),
                 0L, TimeUnit.MILLISECONDS,
                 new ArrayBlockingQueue<>(128), new ThreadPoolExecutor.CallerRunsPolicy());
         HttpRouteHandler routeHandle = new HttpRouteHandler();