python - Error in multiprocessing.Manager().Queue().put -


i using python 2.6.4. have code fetches data, puts in queue. after time, start pulling data queue.

q = multiprocessing.manager().queue() p = multiprocessing.process(target=build_queue, args=(q,)) # build_queue calls q.put , puts object queue.  # process of getting objects put queue slow.  # later, use asynchronous processes pull data queue pool = pool(processes=4)  in range(0, 4):     pool.apply_async(pull_data_from_queue, (q))     time.sleep(120) pool.close() # wait processes finish pool.join() 

in middle of operations, program exits message: “file "(string)", line 2, in put”

if put try-except block around q.put() , print exception, err - print message is: [errno 32] broken pipe

the exact error is:

file "test.py", line 16, in build_queue q.put(y) file "<string>", line 2, in put file "/opt/python/default-2.6/lib/python2.6/multiprocessing/managers.py", line 725, in _callmethod conn.send((self._id, methodname, args, kwds)) ioerror: [errno 32] broken pipe 

any idea why queue.put throws message “file "(string)", line 2, in put” , how solve this?


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -