diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-10-05 21:06:25 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-10-24 21:01:54 -0400 |
commit | 88a7ce3893fe16c7d345e91838722b18ad728740 (patch) | |
tree | fc429629a221f803dccca345f24b1ad06f725565 /includes | |
parent | 8cf50eb1b5f145d7bca9abae6220f4c2622e21b1 (diff) | |
download | haskell-88a7ce3893fe16c7d345e91838722b18ad728740.tar.gz |
rts/stm: Strengthen orderings to SEQ_CST instead of volatilewip/tsan/stm
Previously the `current_value`, `first_watch_queue_entry`, and
`num_updates` fields of `StgTVar` were marked as `volatile` in an
attempt to provide strong ordering. Of course, this isn't sufficient.
We now use proper atomic operations. In most of these cases I strengthen
the ordering all the way to SEQ_CST although it's possible that some
could be weakened with some thought.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/rts/storage/Closures.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h index 3196efd3de..981e162ec1 100644 --- a/includes/rts/storage/Closures.h +++ b/includes/rts/storage/Closures.h @@ -340,9 +340,9 @@ typedef struct StgTVarWatchQueue_ { typedef struct { StgHeader header; - StgClosure *volatile current_value; - StgTVarWatchQueue *volatile first_watch_queue_entry; - StgInt volatile num_updates; + StgClosure *current_value; /* accessed via atomics */ + StgTVarWatchQueue *first_watch_queue_entry; /* accessed via atomics */ + StgInt num_updates; /* accessed via atomics */ } StgTVar; /* new_value == expected_value for read-only accesses */ |