#! /usr/bin/python from multiprocessing import Process, Pipe, Queue from time import sleep SIZE = 100 def queueChild(q): list2D = [[i for i in xrange(j * SIZE, (j * SIZE) + SIZE)] for j in xrange(0,SIZE)] q.put(list2D) #sleep(.5) # Without this delay `list2D` is modified before it is put on the queue list2D[-1][-1] = None def pipeChild(p): list2D = [[i for i in xrange(j * SIZE, (j * SIZE) + SIZE)] for j in xrange(0,SIZE)] p.send(list2D) list2D[-1][-1] = None if __name__ == '__main__': q = Queue() pQueue = Process(target = queueChild, args = (q,)) pQueue.start(); result = q.get(); pQueue.join(); print "\nFinal value via Queue None?", (result[-1][-1] is None) ## # Pipe does not have this problem ## parent_conn, child_conn = Pipe() ## pPipe = Process(target = pipeChild, args = (child_conn,)) ## pPipe.start(); result = parent_conn.recv(); pPipe.join(); ## print "\nFinal value via Pipe is None?", (result[-1][-1] is None) q.close(); q.join_thread()