diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-01-01 21:03:21 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-09 21:21:38 -0500 |
commit | d1b9d679459bcdca064d3049cc76db50c625b1a1 (patch) | |
tree | f6ee30b92f5e32b238b08df3caaff1f3f0d24e87 /rts | |
parent | 83ac5594d101440f72dc0ead97f0d1583056c07d (diff) | |
download | haskell-d1b9d679459bcdca064d3049cc76db50c625b1a1.tar.gz |
rts/Capability: Use relaxed load in findSpark
When checking n_returning_tasks.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Capability.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rts/Capability.c b/rts/Capability.c index dd24ce6681..c30135d695 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -99,7 +99,8 @@ findSpark (Capability *cap) bool retry; uint32_t i = 0; - if (!emptyRunQueue(cap) || cap->n_returning_tasks != 0) { + // This is an approximate check so relaxed load is acceptable here. + if (!emptyRunQueue(cap) || RELAXED_LOAD(&cap->n_returning_tasks) != 0) { // If there are other threads, don't try to run any new // sparks: sparks might be speculative, we don't want to take // resources away from the main computation. |