[pypy-svn] r23252 - pypy/dist/pypy/translator/goal
tismer at codespeak.net
tismer at codespeak.net
Sun Feb 12 13:30:53 CET 2006
Author: tismer
Date: Sun Feb 12 13:30:51 2006
New Revision: 23252
Added:
pypy/dist/pypy/translator/goal/_test_thread.py (contents, props changed)
Log:
temporary check-in of a testing script for thread damage. Should be redesigned and moved into some test folder for tests that need to be run on top of compiled pypy.
Added: pypy/dist/pypy/translator/goal/_test_thread.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/translator/goal/_test_thread.py Sun Feb 12 13:30:51 2006
@@ -0,0 +1,23 @@
+import thread, time
+
+running = []
+
+def f(name, count, modulus):
+ running.append(name)
+ i = 0
+ print "starting", name, count, modulus
+ for i in xrange(count):
+ if i % modulus == 0:
+ print name, i
+ running.remove(name)
+
+thread.start_new_thread(f, ("eins", 10000000, 12345))
+thread.start_new_thread(f, ("zwei", 10000000, 13579))
+thread.start_new_thread(f, ("drei", 10000000, 14680))
+thread.start_new_thread(f, ("vier", 10000000, 15725))
+
+print "waiting for", running, "to finish"
+while running:
+ pass
+print "finished waiting."
+
More information about the Pypy-commit
mailing list