I\'m using Python 2.7.3. I have parallelised some code using subclassed multiprocessing.Process
objects. If there are no errors in the code in my subclassed Process
This is not an answer, just an extended comment. Please run this program an tell us what output (if any) you get:
from multiprocessing import Process, Queue
class Worker(Process):
def __init__(self, inputQueue, outputQueue):
super(Worker, self).__init__()
self.inputQueue = inputQueue
self.outputQueue = outputQueue
def run(self):
for i in iter(self.inputQueue.get, 'STOP'):
# (code that does stuff)
1 / 0 # Dumb error
# (more code that does stuff)
self.outputQueue.put(result)
if __name__ == '__main__':
inq, outq = Queue(), Queue()
inq.put(1)
inq.put('STOP')
w = Worker(inq, outq)
w.start()
I get:
% test.py
Process Worker-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/home/unutbu/pybin/test.py", line 21, in run
1 / 0 # Dumb error
ZeroDivisionError: integer division or modulo by zero
I'm surprised (if) you get nothing.