class_docstr: Start some threads or processes before training.
code: def _after_train(self):
      if not self._stop_at_last:
          return
      for k in self._procs_threads:
          if not k.is_alive():
              continue
          if isinstance(k, mp.Process):
              logger.info("Stopping {} ...".format(k.name))
              k.terminate()
              k.join(5.0)
              if k.is_alive():
                  logger.error("Cannot join process {}.".format(k.name))
          elif isinstance(k, StoppableThread):
              logger.info("Stopping {} ...".format(k.name))
              k.stop()
              k.join(5.0)
              if k.is_alive():
                  logger.error("Cannot join thread {}.".format(k.name))
  
file_path: tensorpack/tensorpack/callbacks/concurrency.py
imports: import multiprocessing
  from ..utils import logger
  from ..utils.concurrency import StoppableThread, start_proc_mask_signal
  from .base import Callback
label_desc: Use image node_id 3 for calling the StartProcOrThread obj's underlying member method code with example usage: obj._after_train() without return types