Set thread affinity with +RTS -qa (only on Linux so far)
[ghc-hetmet.git] / rts / Schedule.c
index 666b59e..636b517 100644 (file)
@@ -2125,6 +2125,10 @@ workerStart(Task *task)
     cap = task->cap;
     RELEASE_LOCK(&task->lock);
 
+    if (RtsFlags.ParFlags.setAffinity) {
+        setThreadAffinity(cap->no, n_capabilities);
+    }
+
     // set the thread-local pointer to the Task:
     taskEnter(task);