[x265] [PATCH 7 of 7] threadpool.cpp: correctly set pool string -> windows system

praveen at multicorewareinc.com praveen at multicorewareinc.com
Fri May 20 13:02:00 CEST 2016


# HG changeset patch
# User Praveen Tiwari <praveen at multicorewareinc.com>
# Date 1463740562 -19800
#      Fri May 20 16:06:02 2016 +0530
# Node ID 7be1c425db3030d901382ceb6c837f5e93014ca8
# Parent  521874f0eea07c26b6a9580302fe61fc7f223e02
threadpool.cpp: correctly set pool string -> windows system

diff -r 521874f0eea0 -r 7be1c425db30 source/common/threadpool.cpp
--- a/source/common/threadpool.cpp	Fri May 20 15:44:40 2016 +0530
+++ b/source/common/threadpool.cpp	Fri May 20 16:06:02 2016 +0530
@@ -284,10 +284,25 @@
 #endif
 
     if (bNumaSupport && p->logLevel >= X265_LOG_DEBUG)
-        for (int i = 0; i < numNumaNodes; i++)
-            x265_log(p, X265_LOG_DEBUG, "detected NUMA node %d with %d logical cores\n", i, cpusPerNode[i]);
-
-    /* limit threads based on param->numaPools */
+    /* limit threads based on param->numaPools
+     * For windows because threads can't be allocated to live across sockets
+     * changing the default behavior to be per-socket pools -- FIXME */
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN7
+     if (!p->numaPools)
+     {
+         char poolString[50] = "";
+         for (int i = 0; i < numNumaNodes; i++)
+         {
+             char nextCount[10] = "";
+             if (i)
+                 sprintf(nextCount, ",%d", cpusPerNode[i]);
+             else
+                   sprintf(nextCount, "%d", cpusPerNode[i]);
+             strcat(poolString, nextCount);
+         }
+         x265_param_parse(p, "pools", poolString);
+     }
+#endif
     if (p->numaPools && *p->numaPools)
     {
         const char *nodeStr = p->numaPools;


More information about the x265-devel mailing list