Author: Armin Rigo <[email protected]>
Branch: gc-small-uniform
Changeset: r1155:dc5ea72bcc5f
Date: 2014-04-12 13:02 +0200
http://bitbucket.org/pypy/stmgc/changeset/dc5ea72bcc5f/
Log: hg merge default
diff --git a/c7/stm/core.c b/c7/stm/core.c
--- a/c7/stm/core.c
+++ b/c7/stm/core.c
@@ -417,6 +417,23 @@
EVENTUALLY(memcmp(dst, src, copy_size) == 0); /* same page */
}
+ /* Do a full memory barrier. We must make sure that other
+ CPUs see the changes we did to the shared page ("S",
+ above) before we check the other segments below with
+ is_private_page(). Otherwise, we risk the following:
+ this CPU writes "S" but the writes are not visible yet;
+ then it checks is_private_page() and gets false, and does
+ nothing more; just afterwards another CPU sets its own
+ private_page bit and copies the page; but it risks doing
+ so before seeing the "S" writes.
+
+ XXX what is the cost of this? If it's high, then we
+ should reorganize the code so that we buffer the second
+ parts and do them by bunch of N, after just one call to
+ __sync_synchronize()...
+ */
+ __sync_synchronize();
+
for (i = 1; i <= NB_SEGMENTS; i++) {
if (i == myself)
continue;
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit