Skip to content
Snippets Groups Projects
Commit 60c3afb7 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

Merge branch 'laws-set-affinity' into 'master'

[LAWS] Set fiber affinity *before* dispatching it, not after

See merge request !189
parents 618e6d51 ce852584
No related branches found
No related tags found
1 merge request!189[LAWS] Set fiber affinity *before* dispatching it, not after
Pipeline #61841 passed
......@@ -53,11 +53,17 @@ void LawsDispatcher::dispatchLoop() {
}
}
// The fiber was marked das runnable. Run it now.
dispatch(fiber);
// Update the affinity if one was set.
// Update the affinity if one was set. Note that we do this
// before dispatching the fiber, as the fiber will change the
// affinity towards the current worker as soon as it starts
// executing, i.e. right now. Also, future code may delete the
// affinity buffer as part of the Fiber's run() method, so it
// may not longer be valid after dispatching it.
workeraffinity_t* const affinity = getAffinityBuffer(fiber);
if (affinity) *affinity = Runtime::getWorkerId();
// The fiber was marked das runnable. Run it now.
dispatch(fiber);
}
recycle(fiber);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment