multiprocess.process

    @timethis
    def 子方法13(self, return_dict):       
         self.test_iter_result, self.pixel_means = self._algo.get_result()
         print("self.test_iter_result000000000", self.test_iter_result)
         logger.info("run_training++++++++++++++++++++")
         return_dict['test_iter_result'] = self.test_iter_result
         return_dict['pixel_means'] = self.pixel_means
         print("return_dict================", return_dict)
         return True

    def 子方法1(self, return_dict):

        _ = self.子方法13(return_dict)
        print("return_dict22222222222222================", return_dict)

    @timethis
    def _run(self):
       
        import multiprocessing
        manager = multiprocessing.Manager()
        return_dict = manager.dict()
        p = multiprocessing.Process(target=子方法1, args=(return_dict,))

        p.start()
        p.join()
        self.test_iter_result = return_dict['test_iter_result']
        self.pixel_means = return_dict['pixel_means']
        print("return_dict33333333333333================", return_dict)

你可能感兴趣的:(python,开发语言)