Author: Armin Rigo <[email protected]>
Branch: extradoc
Changeset: r4731:c34b215e2f6e
Date: 2012-08-30 17:25 +0200
http://bitbucket.org/pypy/extradoc/changeset/c34b215e2f6e/
Log: Add a table of barriers.
diff --git a/talk/stm2012/stmimpl.rst b/talk/stm2012/stmimpl.rst
--- a/talk/stm2012/stmimpl.rst
+++ b/talk/stm2012/stmimpl.rst
@@ -250,6 +250,13 @@
global_to_local[R] = L
return L
+ def LocalizeReadReady(R):
+ if R->h_global:
+ L = Localize(R)
+ else:
+ L = R
+ return L
+
``W = WriteBarrier(P)`` and ``W = WriteBarrierFromReadReady(R)`` are
two versions of the write barrier::
@@ -282,6 +289,27 @@
R->h_possibly_outdated = True
return W
+The above read/write barriers are just the most common cases. A pointer
+to an object in the category ``R`` might actually point to one that is
+in the more precise category ``L`` or ``W``, following the implication
+relationships: ``W => L => R => O => P`` and ``G => P``. Barriers are
+used to bring an object's category in the opposite direction. Here are
+all the interesting conversions, with the five functions above (DRB,
+RRB, LRR, WrB, WFR) as well as seven more potential conversions (``*``)
+that could be implemented more efficiently with slight variations:
+
+ +--------+-----------------------------------+
+ | | From |
+ +--------+-----+-----+-----+-----+-----+-----+
+ | To | P | G | O | R | L | W |
+ +========+=====+=====+=====+=====+=====+=====+
+ | R | DRB |``*``| RRB | |
+ +--------+-----+-----+-----+-----+-----------+
+ | L |``*``|``*``|``*``| LRR | |
+ +--------+-----+-----+-----+-----+-----+-----+
+ | W | WrB |``*``|``*``| WFR |``*``| |
+ +--------+-----+-----+-----+-----+-----+-----+
+
Auto-localization of some objects
----------------------------------------
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit