Python multiprocessing using a List of Queues
I try to create a list of queues using Python 2.7 multiprocessing package.
Each sub-process owns an individual queue and has two tasks: getting
elements from its own queue and putting elements to other sub-processes'
queues. So, each sub-process has to know which queue belongs to it, that's
why I use a list of queues.
I made code as follows:
mgr = multiprocessing.Manager()
sharedQueueList = mgr.list()
for i in xrange(num_processes):
sharedQueueList .append(mgr.Queue())
But, I got the following error message:
raise convert_to_error(kind, result)
RemoteError:
Unserializable message: ('#RETURN', < Queue.Queue instance at 0x02AD3170 >)
Any ideas? Thanks!
No comments:
Post a Comment