[pypy-commit] stmgc c7-more-segments: More debugging info
arigo
noreply at buildbot.pypy.org
Sun Mar 16 12:25:17 CET 2014
Author: Armin Rigo <arigo at tunes.org>
Branch: c7-more-segments
Changeset: r1040:b38942a05903
Date: 2014-03-16 12:24 +0100
http://bitbucket.org/pypy/stmgc/changeset/b38942a05903/
Log: More debugging info
diff --git a/c7/test/test_random.py b/c7/test/test_random.py
--- a/c7/test/test_random.py
+++ b/c7/test/test_random.py
@@ -54,7 +54,7 @@
e.g. maintains read/write sets. The state will be
discarded on abort or pushed to other threads"""
- def __init__(self, start_time):
+ def __init__(self, start_time, thread_num=None):
self.read_set = set()
self.write_set = set()
self.values = {}
@@ -63,6 +63,7 @@
self.objs_in_conflict = set()
self.inevitable = False
self.created_in_this_transaction = set()
+ self.thread_num = thread_num
def get_old_modified(self):
# returns only the ones that are modified and not from
@@ -74,6 +75,8 @@
if objs_in_conflict is not None:
self.objs_in_conflict |= objs_in_conflict
self._must_abort = True
+ color = "\033[%dm" % (31 + self.thread_num % 6)
+ print >> sys.stderr, color + "# must abort: %r\033[0m" % (objs_in_conflict,)
def check_must_abort(self):
return self._must_abort
@@ -180,10 +183,10 @@
r, int(ffi.cast("uintptr_t", ex.content[r])),
stm_get_obj_size(ex.content[r])))
- def start_transaction(self):
+ def start_transaction(self, thread_num):
assert self.transaction_state is None
start_time = self.global_state.inc_and_get_global_time()
- trs = TransactionState(start_time)
+ trs = TransactionState(start_time, thread_num)
trs.update_from_committed(
self.global_state.committed_transaction_state)
self.transaction_state = trs
@@ -305,7 +308,7 @@
def op_start_transaction(ex, global_state, thread_state):
- thread_state.start_transaction()
+ thread_state.start_transaction(ex.thread_num)
#
ex.do('self.start_transaction()')
thread_state.reload_roots(ex)
More information about the pypy-commit
mailing list