class_docstr: An Analysis is the application of a particular pipeline of modules to a
  set of images to produce measurements.
  
  Multiprocessing for analyses is handled by multiple layers of threads and
  processes, to keep the GUI responsive and simplify the code.  Threads and
  processes are organized as below.  Display/Interaction requests and
  Exceptions are sent directly to the pipeline listener.
  
  +------------------------------------------------+
  |           CellProfiler GUI/WX thread           |
  |                                                |
  +- Analysis() methods down,  Events/Requests up -+
  |                                                |
  |       AnalysisRunner.interface() thread        |
  |                                                |
  +----------------  Queues  ----------------------+
  |                                                |
  |  AnalysisRunner.jobserver()/announce() threads |
  |                                                |
  +----------------------------------------------- +
  |              zmqrequest.Boundary()             |
  +---------------+----------------+---------------+
  |     Worker    |     Worker     |   Worker      |
  +---------------+----------------+---------------+
  
  Workers are managed by class variables in the AnalysisRunner.
code: def cancel(self):
      with self.runner_lock:
          if not self.analysis_in_progress:
              return
          self.analysis_in_progress = False
          self.runner.cancel()
          self.runner = None
          """
              Explicitly call GC here so that the old runner's threads and 
              queues get deleted before any new analysis can be started.
              On rare occasions CP can hang when threads get GC'd during a run
              """
          gc.collect()
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/analysis/_analysis.py
imports: import gc
  import threading
  import uuid
  from ._runner import Runner
  from ..measurement import Measurements
label_desc: Use image node_id 5 for calling the Analysis obj's underlying member method code with example usage: obj.cancel() without return types