Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python multiprocessing queue

def f(q):
    q.put([42, None, "hello"])


if __name__ == "__main__":
    q = mp.Queue()
    p = mp.Process(target=f, args=(q,))
    p.start()
    print(q.get())  # prints "[42, None, 'hello']"
    p.join()
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python #multiprocessing #queue
ADD COMMENT
Topic
Name
3+2 =