> #--------------- temp.py ------------------------- > #run at Python 2.7 command prompt > import time > import multiprocessing as mp > lst = [] > lstlst = [] > > def alist(x): > lst.append(x) > lstlst.append(lst) > print "a" > return lst > > if __name__=='__main__': > pool = mp.Pool(3) > print pool.map(alist,range(3)) #UNEXPECTED RESULTS > print "b" > time.sleep(0.1) > > print "c" > print lst > print lstlst > --
I get several different results: $ for i in {1..1000}; do > python2.7 temp.py | md5sum >> result > done $ wc -l result 1000 result $ sort result | uniq | wc -l 9 -- https://mail.python.org/mailman/listinfo/python-list