Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r71325:b5b91700900b
Date: 2014-05-06 10:57 +0200
http://bitbucket.org/pypy/pypy/changeset/b5b91700900b/

Log:    Attempt to solve a remaining source of conflicts

diff --git a/pypy/objspace/std/mapdict.py b/pypy/objspace/std/mapdict.py
--- a/pypy/objspace/std/mapdict.py
+++ b/pypy/objspace/std/mapdict.py
@@ -159,7 +159,12 @@
             size_est = (oldattr._size_estimate + attr.size_estimate()
                                                - oldattr.size_estimate())
             assert size_est >= (oldattr.length() * NUM_DIGITS_POW2)
-            oldattr._size_estimate = size_est
+            # This write is "stm ignored", which means that we're doing
+            # a best-effort attempt at updating the value, but other threads
+            # may or may not see the update.  The benefit is that it will
+            # never create conflicts.
+            with objectmodel.stm_ignored:
+                oldattr._size_estimate = size_est
         if attr.length() > obj._mapdict_storage_length():
             # note that attr.size_estimate() is always at least attr.length()
             new_storage = [None] * attr.size_estimate()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to