[pypy-issue] [issue797] Deadlock with threads

Alex Gaynor tracker at bugs.pypy.org
Sat Jul 16 02:00:37 CEST 2011

New submission from Alex Gaynor <alex.gaynor at gmail.com>:

Running this code under PyPy trunk (or 1.5) on Linux 64 results in a deadlock:

import threading

def get_results():

def main():
    i = 0
    while i < 5000000:
        t = threading.Thread(target=get_results)
        i += 1
        if i % 1000 == 0:
            print i


According to mitsuhiko it reproduces on OS X for him, but *not* when using 1.4.0.  I 
cannot reproduce this on Linux with --jit off.  This doesn't necessarily mean the JIT 
causes it unfortunately, it could be that the increased speed is the cause (which 
would explain why it doesn't reproduce on CPython possibly).  Or it could be a JIT 

messages: 2809
nosy: agaynor, pypy-issue
priority: bug
status: unread
title: Deadlock with threads

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list