Message75804
The "devel" documentation of the "Multiprocessing" module at the
"Exchanging objects between processes" section has the following example
snippet:
from multiprocessing import Process, Queue
def f(q):
q.put([42, None, 'hello'])
if __name__ == '__main__':
q = Queue()
p = Process(target=f, args=(q,))
p.start()
print q.get() # prints "[42, None, 'hello']"
p.join()
The last two lines should be swapped to avoid a race condition:
p.join()
print q.get() # prints "[42, None, 'hello']"
BTW, Nice work. Keep on going folks =) |
|
Date |
User |
Action |
Args |
2008-11-12 22:35:25 | alejolp | set | recipients:
+ alejolp, georg.brandl |
2008-11-12 22:35:23 | alejolp | set | messageid: <1226529323.41.0.396977390286.issue4311@psf.upfronthosting.co.za> |
2008-11-12 22:35:22 | alejolp | link | issue4311 messages |
2008-11-12 22:35:21 | alejolp | create | |
|