Author: Armin Rigo <[email protected]>
Branch: extradoc
Changeset: r4675:620d77f84a51
Date: 2012-08-17 14:33 +0200
http://bitbucket.org/pypy/extradoc/changeset/620d77f84a51/

Log:    Add a paragraph about the violation of immutability.

diff --git a/talk/stm2012/stmimpl.rst b/talk/stm2012/stmimpl.rst
--- a/talk/stm2012/stmimpl.rst
+++ b/talk/stm2012/stmimpl.rst
@@ -350,6 +350,14 @@
             # update the original field
             R_Container->FieldName = R
 
+This last line is a violation of the rule that global objects are
+immutable.  It still works because it is only an optimization that will
+avoid some chain-walking in the future.  If two threads conflict in
+updating the same field to possibly different values, it is undefined
+what exactly occurs: other CPUs can see either the original or any of
+the modified values.  It works because the original and each modified
+value are all interchangeable as far as correctness goes.
+
 
 Committing
 ------------------------------------
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to