Message98548
Kaushik, in your example, d is a dict proxy, so assignment to d['f'] correctly ferries the assignment (a new normal dict) to the d['f'] in the original process. The new dict, however, is not a dict proxy, it's just a dict, so assignment of d['f']['msg'] goes nowhere. All hope is not lost, however, because the Manager can be forked to new processes. The slightly modified example below shows how this works:
from multiprocessing import Process, Manager
def f(m, d):
d['f'] = m.dict()
d['f']['msg'] = 'I am here'
m = Manager()
d = m.dict()
p = Process(target=f, args=(m,d))
p.start()
p.join()
print d
{'f': <DictProxy object, typeid 'dict' at 0x7f1517902810>}
print d['f']
{'msg': 'I am here'}
With the attached patch, the above works as shown, without, it gives the same output as your original example. |
|
Date |
User |
Action |
Args |
2010-01-30 04:06:22 | terrence | set | recipients:
+ terrence, jnoller, carlosdf, kghose |
2010-01-30 04:06:22 | terrence | set | messageid: <1264824382.31.0.719765089694.issue6766@psf.upfronthosting.co.za> |
2010-01-30 04:06:20 | terrence | link | issue6766 messages |
2010-01-30 04:06:19 | terrence | create | |
|