我在进程之间共享一个字典,每个进程在字典中插入一个条目,其中字典中键的值可以是列表或 gdb.Value 实例。每个进程都在做这样的事情
mydict["key"] = [[2], gdb.Value(someaddress), 3, 4]
执行上述行时,我收到以下错误,看起来像是因为我正在插入 gdb.Value,如果是 object() 实例,则此方法有效
Traceback (most recent call last):
File "/test.py", line 631, in insert
mydict["key"] = [[2], 1, 3, 4]
File "<string>", line 2, in __setitem__
File "/usr/lib/python2.7/multiprocessing/managers.py", line 774, in _callmethod
raise convert_to_error(kind, result)
RemoteError:
---------------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/managers.py", line 240, in serve_client
request = recv()
TypeError: Value object creation takes only 1 argument
我也看到了另一个问题,循环遍历字典给了我以下错误
Traceback (most recent call last):
File "/test.py", line 1214, in <module>
for item in mydict:
File "<string>", line 2, in __getitem__
File "/usr/lib/python2.7/multiprocessing/managers.py", line 774, in _callmethod
raise convert_to_error(kind, result)