[pypy-commit] pypy stmgc-c7: Use stm_become_globally_unique_transaction here

arigo noreply at buildbot.pypy.org
Sat Mar 22 20:05:47 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r70173:95d7a38c9d56
Date: 2014-03-22 20:03 +0100
http://bitbucket.org/pypy/pypy/changeset/95d7a38c9d56/

Log:	Use stm_become_globally_unique_transaction here

diff --git a/rpython/rlib/rstm.py b/rpython/rlib/rstm.py
--- a/rpython/rlib/rstm.py
+++ b/rpython/rlib/rstm.py
@@ -6,10 +6,6 @@
 from rpython.rlib.jit import dont_look_inside
 
 
-def stop_all_other_threads(): "XXX"
-def partial_commit_and_resume_other_threads(): "XXX"
-
-
 TID = rffi.UINT
 tid_offset = CDefinedIntSymbolic('offsetof(struct rpyobj_s, tid)')
 adr_nursery_free = CDefinedIntSymbolic('(long)(&STM_SEGMENT->nursery_current)')
@@ -35,6 +31,13 @@
     llop.stm_become_inevitable(lltype.Void)
 
 @dont_look_inside
+def stop_all_other_threads():
+    llop.stm_become_globally_unique_transaction(lltype.Void)
+
+def partial_commit_and_resume_other_threads():
+    pass    # for now
+
+ at dont_look_inside
 def should_break_transaction():
     return we_are_translated() and (
         llop.stm_should_break_transaction(lltype.Bool))
diff --git a/rpython/rtyper/lltypesystem/lloperation.py b/rpython/rtyper/lltypesystem/lloperation.py
--- a/rpython/rtyper/lltypesystem/lloperation.py
+++ b/rpython/rtyper/lltypesystem/lloperation.py
@@ -426,6 +426,7 @@
     'stm_identityhash':       LLOp(canfold=True),
     'stm_addr_get_tid':       LLOp(canfold=True),
     'stm_become_inevitable':  LLOp(canmallocgc=True),
+    'stm_become_globally_unique_transaction': LLOp(canmallocgc=True),
     'stm_push_root':          LLOp(),
     'stm_pop_root_into':      LLOp(),
     'stm_commit_if_not_atomic':           LLOp(canmallocgc=True),
diff --git a/rpython/translator/stm/funcgen.py b/rpython/translator/stm/funcgen.py
--- a/rpython/translator/stm/funcgen.py
+++ b/rpython/translator/stm/funcgen.py
@@ -129,6 +129,9 @@
     string_literal = c_string_constant(info)
     return 'stm_become_inevitable(%s);' % (string_literal,)
 
+def stm_become_globally_unique_transaction(funcgen, op):
+    return 'stm_become_globally_unique_transaction("for the JIT");'
+
 def stm_push_root(funcgen, op):
     arg0 = funcgen.expr(op.args[0])
     return 'STM_PUSH_ROOT(stm_thread_local, %s);' % (arg0,)


More information about the pypy-commit mailing list