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
Copy file name to clipboardExpand all lines: concurrency-primer.tex
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -941,7 +941,8 @@ \subsection{ABA problem}
941
941
Also, the possibility to allocate a job with same address could be higher when using memory pool, meaning that more chances to have ABA problem occurred.
942
942
In fact, pre-allocated memory should be used to achieve lock-free since \monobox{malloc} could have mutex involved in multi-threaded environment.
943
943
944
-
Failure to recognize changed target object through comparison can result in stale information.
944
+
Being unable to determine whether the target object has been changed through comparison could result in a false positive when the return value of CAS is true.
945
+
Thus, the atomicity provided by CAS is not guaranteed.
945
946
The general concept of solving this problem involves adding more information to make different state distinguishable, and then making a decision on whether to act on the old state or retry with the new state.
946
947
If acting on the old state is chosen, then safe memory reclamation should be considered as memory may have already been freed by other threads.
947
948
More aggressively, one might consider the programming paradigm where each operation on the target object does not have a side effect on modifying it.
0 commit comments