I am debugging a multiprocessor program with anaconda2 in the pycharm community release. It has several background workflows. The workflow checks the input queue to retrieve the task without sleep before receiving the task. In fact, I am only interested in the main process. But the pycharm debugger always goes into the subprocess, it seems that the main process is not working, and the task is never sent. How can I make a debugger from a subprocess? The worker subprocess is as follows:
class ILSVRC_worker:
...
def run(self):
cfg_parser = ConfigParser.ConfigParser()
cfg_parser.read(self.cfg_path)
data_factory = ILSVRC_DataFactory(cfg_parser)
logger = mp.log_to_stderr(logging.INFO)
while True:
try:
annotation_path = self.que_in.get(True,0.1)
except Queue.Empty:
continue
if annotation_path is None:
logger.info('exit the worker process')
break
...
source
share