[pypy-commit] stmgc default: Clear the fxcache when we want to be sure to get a conflict.

arigo noreply at buildbot.pypy.org
Wed Jun 12 23:02:02 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r106:e11ad4a6f501
Date: 2013-06-12 22:43 +0200
http://bitbucket.org/pypy/stmgc/changeset/e11ad4a6f501/

Log:	Clear the fxcache when we want to be sure to get a conflict.

diff --git a/c4/et.c b/c4/et.c
--- a/c4/et.c
+++ b/c4/et.c
@@ -39,6 +39,10 @@
 {
   return is_private(P);
 }
+void stm_clear_read_cache(void)
+{
+  fxcache_clear(&thread_descriptor->recent_reads_cache);
+}
 
 /************************************************************/
 
diff --git a/c4/et.h b/c4/et.h
--- a/c4/et.h
+++ b/c4/et.h
@@ -169,6 +169,7 @@
 int _stm_is_private(gcptr);  /* debugging */
 gcptr stm_get_private_from_protected(long);  /* debugging */
 gcptr stm_get_read_obj(long);  /* debugging */
+void stm_clear_read_cache(void);  /* debugging */
 gcptr stmgc_duplicate(gcptr);
 
 int DescriptorInit(void);
diff --git a/c4/test/support.py b/c4/test/support.py
--- a/c4/test/support.py
+++ b/c4/test/support.py
@@ -72,6 +72,7 @@
     gcptr stm_get_private_from_protected(long index);
     gcptr stm_get_read_obj(long index);
     void *STUB_THREAD(gcptr);
+    void stm_clear_read_cache(void);
 
     gcptr getptr(gcptr, long);
     void setptr(gcptr, long, gcptr);
diff --git a/c4/test/test_random.py b/c4/test/test_random.py
--- a/c4/test/test_random.py
+++ b/c4/test/test_random.py
@@ -126,9 +126,11 @@
             pobj = self.current_rev.read(r.obj, index)
             if not self.is_private(r.ptr):
                 self.current_rev.check_not_outdated(r.obj)
-        except (model.Deleted, model.Conflict):
+        except (model.Deleted, model.Conflict), e:
             # abort! try to reproduce with C code
+            self.dump('expecting abort: %r' % (e,))
             self.expected_abort()
+            lib.stm_clear_read_cache()
             lib.getptr(r.ptr, index)             # should abort
             raise MissingAbort
 


More information about the pypy-commit mailing list