[x265] [PATCH] [PATCH] threadpool: use all available threads on each NUMA node with --pools=NULL option too

mahesh at multicorewareinc.com mahesh at multicorewareinc.com
Thu Dec 17 18:59:44 CET 2015


# HG changeset patch
# User Mahesh Pittala <mahesh at multicorewareinc.com>
# Date 1450375170 -19800
#      Thu Dec 17 23:29:30 2015 +0530
# Node ID d3451b996e26740e8a2e2f4f4d9b6d91cfa52958
# Parent  9c797a5915814a74663f4f1f4edf8a9fd17d5c42
[PATCH] threadpool: use all available threads on each NUMA node with --pools=NULL option too


from x265.readthedocs, --pools = NULL, "", "*" are doing same functionality.
--pools="" & --pools="*" are using all threads but when we pass --pools=NULL, disabled
all threads pools but supposed to enable.

diff -r 9c797a591581 -r d3451b996e26 source/common/threadpool.cpp
--- a/source/common/threadpool.cpp	Thu Dec 10 21:37:01 2015 +0530
+++ b/source/common/threadpool.cpp	Thu Dec 17 23:29:30 2015 +0530
@@ -268,6 +268,10 @@
     if (p->numaPools && *p->numaPools)
     {
         const char *nodeStr = p->numaPools;
+        char nodeStrupper[100];
+        for(int i = 0; nodeStr[i]; i++)
+            nodeStrupper[i] = toupper(nodeStr[i]);
+        nodeStrupper[strlen(nodeStr)] = '\0';
         for (int i = 0; i < numNumaNodes; i++)
         {
             if (!*nodeStr)
@@ -277,7 +281,7 @@
             }
             else if (*nodeStr == '-')
                 threadsPerPool[i] = 0;
-            else if (*nodeStr == '*')
+            else if (*nodeStr == '*' || !strcmp(nodeStrupper, "NULL"))
             {
                 for (int j = i; j < numNumaNodes; j++)
                 {


More information about the x265-devel mailing list