SegFault using deque in 2.4b3

George Yoshida ml at dynkin.com
Thu Sep 30 14:34:37 EDT 2004


A bit simpler version(narrow the problem).

##  START OF PROGRAM
import threading
import random
from collections import deque

class Deq(threading.Thread):
     N = 10 ** 4
     def __init__(self):
         threading.Thread.__init__(self)
         self.d = deque()

     def run(self):
         for i in xrange(self.N):
             n  = random.random()
             if n < 0.5:
                 self.d.append(self)
         else:
             print ".",

def main():
     for i in xrange(40):
         deq = Deq()
         deq.start()

if __name__ == '__main__':
     main()
##  END OF PROGRAM

- George



More information about the Python-list mailing list