[pypy-commit] stmgc default: some floating uncommitted changes to htm-c7

Raemi noreply at buildbot.pypy.org
Tue Apr 29 09:27:14 CEST 2014


Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch: 
Changeset: r1193:ff3d33869baa
Date: 2014-04-29 09:29 +0200
http://bitbucket.org/pypy/stmgc/changeset/ff3d33869baa/

Log:	some floating uncommitted changes to htm-c7

diff --git a/htm-c7/stmgc.c b/htm-c7/stmgc.c
--- a/htm-c7/stmgc.c
+++ b/htm-c7/stmgc.c
@@ -29,6 +29,7 @@
 static void acquire_gil(stm_thread_local_t *tl) {
     if (pthread_mutex_lock(&_stm_gil) == 0) {
         _stm_tloc = tl;
+        STM_SEGMENT->running_thread = tl;
         _htm_info.use_gil = 1;
         return;
     }
@@ -121,11 +122,14 @@
     }
 
     _stm_tloc = tl;
+    STM_SEGMENT->running_thread = tl;
 }
 
+
 void stm_commit_transaction(void) {
     stm_collect(0);
     _stm_tloc = NULL;
+    STM_SEGMENT->running_thread = NULL;
     if (_htm_info.use_gil) {
         OPT_ASSERT(!xtest());
         if (pthread_mutex_unlock(&_stm_gil) != 0) abort();
@@ -338,7 +342,7 @@
 /************************************************************/
 
 
-#define NB_NURSERY_PAGES    1024          // 4MB
+#define NB_NURSERY_PAGES    1          // 1 page
 #define NURSERY_SIZE        (NB_NURSERY_PAGES * 4096UL)
 
 __thread char *_stm_nursery_base    = NULL;
diff --git a/htm-c7/stmgc.h b/htm-c7/stmgc.h
--- a/htm-c7/stmgc.h
+++ b/htm-c7/stmgc.h
@@ -44,6 +44,7 @@
     stm_jmpbuf_t *jmpbuf_ptr;  /* compat only -- always NULL */
     char *nursery_current;     /* updated... */
     int segment_num;  /* compat only -- always NULL */
+    stm_thread_local_t *running_thread;
 };
 //extern struct stm_segment_info_s _stm_segment;
 extern __thread struct stm_segment_info_s *_stm_segment;
@@ -158,4 +159,6 @@
     // XXX ignored
 }
 
+inline static void stm_flush_timing(stm_thread_local_t *tl, int verbose) {}
+
 #endif


More information about the pypy-commit mailing list