X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FPLRsearch%2FPLRsearch.py;h=ec58fbd10f61c9136c01539e229960daec9a729e;hb=e08706e85b412b1307df3789fdbe747b43c2bd95;hp=fb4ee1a4d017f18dc15eef45f45aa6b2519eea3b;hpb=9378751a08ca5660886927f5502dcef19bc7f51c;p=csit.git diff --git a/resources/libraries/python/PLRsearch/PLRsearch.py b/resources/libraries/python/PLRsearch/PLRsearch.py index fb4ee1a4d0..ec58fbd10f 100644 --- a/resources/libraries/python/PLRsearch/PLRsearch.py +++ b/resources/libraries/python/PLRsearch/PLRsearch.py @@ -601,15 +601,17 @@ class PLRsearch: dilled_function = dill.dumps(value_logweight_func) boss_pipe_end, worker_pipe_end = multiprocessing.Pipe() - boss_pipe_end.send( - (dimension, dilled_function, focus_tracker, max_samples) - ) + # Do not send yet, run the worker first to avoid a deadlock. + # See https://stackoverflow.com/a/15716500 worker = multiprocessing.Process( target=Integrator.try_estimate_nd, args=(worker_pipe_end, 10.0, self.trace_enabled) ) worker.daemon = True worker.start() + boss_pipe_end.send( + (dimension, dilled_function, focus_tracker, max_samples) + ) return boss_pipe_end erf_pipe = start_computing(self.lfit_erf, erf_focus_tracker)