Commit 77f9705a authored by Kevin Modzelewski's avatar Kevin Modzelewski

This one crashes Pyston reliably

parent a3270966
# skip-if: True
# - Pyston is not yet thread safe. this test sometimes works and sometimes doesn't.
# - threads also seem to cause much greater memory usage for both CPython and Pyston and
# blow out the memory limits set by the tester.
from thread import start_new_thread
import time
work = []
done = []
def run(num):
work.append(num)
for i in xrange(num):
t = work.pop()
work.append(t - 1)
done.append(num)
print "starting!"
nthreads = 2
for i in xrange(nthreads):
t = start_new_thread(run, (1000000,))
while len(done) < nthreads:
time.sleep(0)
print work, sum(work)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment