Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r76028:c0860a9ad1db
Date: 2015-02-21 09:50 +0100
http://bitbucket.org/pypy/pypy/changeset/c0860a9ad1db/
Log: Improve the test, still failing
diff --git a/pypy/module/pypystm/test_pypy_c/test_no_conflict.py
b/pypy/module/pypystm/test_pypy_c/test_no_conflict.py
--- a/pypy/module/pypystm/test_pypy_c/test_no_conflict.py
+++ b/pypy/module/pypystm/test_pypy_c/test_no_conflict.py
@@ -29,14 +29,31 @@
#
self.check_almost_no_conflict(f)
+ def test_hashtable_populate(self):
+ def f():
+ import pypystm
+ class TL(object):
+ step = 0
+ d = pypystm.hashtable() # shared
+ def g(n, tl):
+ value = n + tl.step
+ tl.step += 10
+ d[value] = tl
+ run_in_threads(g, arg_thread_num=True, arg_class=TL)
+ #
+ self.check_almost_no_conflict(f)
+
def test_stmdict_populate(self):
def f():
- import pypystm, random
+ import pypystm
+ class TL(object):
+ step = 0
d = pypystm.stmdict() # shared
- def g(r):
- value = r.randrange(0, 1000000000)
- d[value] = None
- run_in_threads(g, arg_class=random.Random)
+ def g(n, tl):
+ value = n + tl.step
+ tl.step += 10
+ d[value] = tl
+ run_in_threads(g, arg_thread_num=True, arg_class=TL)
#
self.check_almost_no_conflict(f)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit