我在進程之間共享字典,每個進程在dict中插入一個條目,其中字典中的鍵值可以是列表或gdb.Value實例。 每個進程正在做這樣的事情包含值列表的Python multiprocessing.Manager字典
mydict["key"] = [[2], gdb.Value(someaddress), 3, 4]
當上述行執行我得到下面的錯誤,看起來像它,因爲我將gdb.Value,這個工作如果在一個對象()實例
的情況下,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)
我怎麼固定的轉變gdb.Value到Python INT /長和存儲它代替 – PMat