diff options
author | aappleby@google.com <aappleby@google.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a> | 2011-04-04 23:38:12 +0000 |
---|---|---|
committer | aappleby@google.com <aappleby@google.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a> | 2011-04-04 23:38:12 +0000 |
commit | 4bbda98dc256abd514bb2011560cded111fd205b (patch) | |
tree | e74973e0d9764b01a243e1d4e7034c1ff7c69dd8 | |
parent | 9715053bffb6aa255104427c756084e815e530aa (diff) | |
download | src-4bbda98dc256abd514bb2011560cded111fd205b.tar.gz |
Add CPU affinity to gcc build
git-svn-id: http://smhasher.googlecode.com/svn/trunk@123 77a7d1d3-4c08-bdc2-d393-d5859734b01a
-rw-r--r-- | Platform.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Platform.cpp b/Platform.cpp index dff36cb..bed3aa1 100644 --- a/Platform.cpp +++ b/Platform.cpp @@ -21,8 +21,20 @@ void SetAffinity ( int cpu ) #else
+#include <sched.h>
+
void SetAffinity ( int /*cpu*/ )
{
+ cpu_set_t mask;
+
+ CPU_ZERO(&mask);
+
+ CPU_SET(2,&mask);
+
+ if( sched_setaffinity(0,sizeof(mask),&mask) == -1)
+ {
+ printf("WARNING: Could not set CPU affinity\n");
+ }
}
#endif
|