You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we use \monobox{compare\_exchange\_strong} for this family of algorithms,
729
727
the compiler must emit nested loops:
730
-
an inner one to protect us from spurious \textsc{sc} failures,
728
+
an inner one to protect us from spurious \textsc{SC} failures,
731
729
and an outer one which repeatedly performs our operation until no other thread has interrupted us.
732
730
But unlike the \monobox{\_strong} version,
733
-
a weak \textsc{CAS} is allowed to fail spuriously, just like the \textsc{ll/sc} mechanism that implements it.
731
+
a weak \textsc{CAS} is allowed to fail spuriously, just like the \textsc{LL/SC} mechanism that implements it.
734
732
So, with \monobox{compare\_exchange\_weak},
735
733
the compiler is free to generate a single loop,
736
-
since we do not care about the difference between retries from spurious \textsc{sc} failures and retries caused by another thread modifying our variable.
734
+
since we do not care about the difference between retries from spurious \textsc{SC} failures and retries caused by another thread modifying our variable.
737
735
738
736
\section{Do we always need sequentially consistent operations?}
0 commit comments