Commit 5ad67f0a authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs #5508 remove cpu affinity code that calculates the number of processors...

refs #5508 remove cpu affinity code that calculates the number of processors from the portability layer

git-svn-id: file:///svn/toku/tokudb@48302 c7de825b-a66e-492c-adef-691d508d4ae1
parent bd932e89
...@@ -67,26 +67,9 @@ toku_os_get_number_processors(void) { ...@@ -67,26 +67,9 @@ toku_os_get_number_processors(void) {
return sysconf(_SC_NPROCESSORS_CONF); return sysconf(_SC_NPROCESSORS_CONF);
} }
#if defined(HAVE_SCHED_GETAFFINITY)
#include <sched.h>
#endif
int int
toku_os_get_number_active_processors(void) { toku_os_get_number_active_processors(void) {
int n = sysconf(_SC_NPROCESSORS_ONLN); int n = sysconf(_SC_NPROCESSORS_ONLN);
#if defined(HAVE_SCHED_GETAFFINITY)
{
cpu_set_t cpuset;
int r = sched_getaffinity(getpid(), sizeof cpuset, &cpuset);
assert(r == 0);
int ncpus = 0;
for (unsigned i = 0; i < 8 * sizeof cpuset; i++)
if (CPU_ISSET(i, &cpuset))
ncpus++;
assert(ncpus <= n);
n = ncpus;
}
#endif
#define DO_TOKU_NCPUS 1 #define DO_TOKU_NCPUS 1
#if DO_TOKU_NCPUS #if DO_TOKU_NCPUS
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment