<div dir="ltr">Please ignore this sending updated patch. thanks.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Regards,<div>Praveen</div></div></div></div>
<br><div class="gmail_quote">On Tue, May 17, 2016 at 7:17 PM, <span dir="ltr"><<a href="mailto:praveen@multicorewareinc.com" target="_blank">praveen@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Praveen Tiwari <<a href="mailto:praveen@multicorewareinc.com">praveen@multicorewareinc.com</a>><br>
# Date 1463492830 -19800<br>
# Tue May 17 19:17:10 2016 +0530<br>
# Node ID cf3c2e0dce0997a499ae1d50fda6891cae83e685<br>
# Parent 372fc5b12ed6003f8784702956ccf7203ea68a2e<br>
ThreadPool.cpp: fix getCpuCount function for windows systems<br>
<br>
diff -r 372fc5b12ed6 -r cf3c2e0dce09 source/common/threadpool.cpp<br>
--- a/source/common/threadpool.cpp Tue May 17 19:06:36 2016 +0530<br>
+++ b/source/common/threadpool.cpp Tue May 17 19:17:10 2016 +0530<br>
@@ -545,9 +545,17 @@<br>
int ThreadPool::getCpuCount()<br>
{<br>
#if _WIN32<br>
- SYSTEM_INFO sysinfo;<br>
- GetSystemInfo(&sysinfo);<br>
- return sysinfo.dwNumberOfProcessors;<br>
+ enum { MAX_NODE_NUM = 127 };<br>
+ int cpus = 0;<br>
+ int numNumaNodes = X265_MIN(getNumaNodeCount(), MAX_NODE_NUM);<br>
+ PGROUP_AFFINITY groupAffinityPointer = new GROUP_AFFINITY;<br>
+ for (int i = 0; i < numNumaNodes; i++)<br>
+ {<br>
+ GetNumaNodeProcessorMaskEx((UCHAR)i, groupAffinityPointer);<br>
+ cpus += (int)bitCount(groupAffinityPointer->Mask);<br>
+ }<br>
+ delete groupAffinityPointer;<br>
+ return cpus;<br>
#elif __unix__ && X265_ARCH_ARM<br>
/* Return the number of processors configured by OS. Because, most embedded linux distributions<br>
* uses only one processor as the scheduler doesn't have enough work to utilize all processors */<br>
</blockquote></div><br></div>