projects
/
IRC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac9babd
)
affinity call
author
bdemsky
<bdemsky>
Wed, 17 Nov 2010 07:27:23 +0000
(07:27 +0000)
committer
bdemsky
<bdemsky>
Wed, 17 Nov 2010 07:27:23 +0000
(07:27 +0000)
Robust/src/Runtime/affinity.h
[new file with mode: 0644]
patch
|
blob
diff --git a/Robust/src/Runtime/affinity.h
b/Robust/src/Runtime/affinity.h
new file mode 100644
(file)
index 0000000..
1834d7b
--- /dev/null
+++ b/
Robust/src/Runtime/affinity.h
@@ -0,0
+1,16
@@
+#ifndef AFFINITY_H
+#define AFFINITY_H
+
+static void set_affinity(unsigned long cpu) {
+ int err;
+ cpu_set_t cpumask;
+
+ CPU_ZERO(&cpumask);
+ CPU_SET(cpu, &cpumask);
+ err = sched_setaffinity(syscall(SYS_gettid),
+ sizeof(cpu_set_t), &cpumask);
+
+ if (err == -1)
+ printf("set_affinity: %s\n", strerror(errno));
+}
+#endif