class_docstr: Create multiple dataflow instances and run them each in one thread.
  Collect outputs from them with a queue.
  
  Note:
      1. (Data integrity) An iterator cannot run faster automatically -- what's happening is
         that each thread will create a dataflow iterator.
         There will be ``num_thread`` dataflow running in parallel and **independently**.
         As a result, we have the following guarantee on the dataflow correctness:
  
         a. When ``num_thread=1``, this dataflow produces the same data as the
            given dataflow in the same order.
         b. When ``num_thread>1``, if each sample from the given dataflow is i.i.d.,
            then this dataflow produces the **same distribution** of data as the given dataflow.
            This implies that there will be duplication, reordering, etc.
            You probably only want to use it for training.
  
            For example, if your original dataflow contains no randomness and produces the same first datapoint,
            then after parallel prefetching, the datapoint will be produced ``num_thread`` times
            at the beginning.
            Even when your original dataflow is fully shuffled, you still need to be aware of the
            `Birthday Paradox <https://en.wikipedia.org/wiki/Birthday_problem>`_
            and know that you'll likely see duplicates.
  
         To utilize parallelism with more strict data integrity, you can use
         the parallel versions of :class:`MapData`: :class:`MultiThreadMapData`, :class:`MultiProcessMapData`.
class_docstr_tok: ["Create","multiple","dataflow","instances","and","run","them","each","in","one","thread",".","Collect","outputs","from","them","with","a","queue",".","Note",":","1",".","(","Data","integrity",")","An","iterator","can","not","run","faster","automatically","--","what","'s","happening","is","that","each","thread","will","create","a","dataflow","iterator",".","There","will","be","``","num_thread","``","dataflow","running","in","parallel","and","*","*","independently","*","*",".","As","a","result",",","we","have","the","following","guarantee","on","the","dataflow","correctness",":","a",".","When","``","num_thread=1","``",",","this","dataflow","produces","the","same","data","as","the","given","dataflow","in","the","same","order",".","b",".","When","``","num_thread",">","1","``",",","if","each","sample","from","the","given","dataflow","is","i.i.d.",",","then","this","dataflow","produces","the","*","*","same","distribution","*","*","of","data","as","the","given","dataflow",".","This","implies","that","there","will","be","duplication",",","reordering",",","etc",".","You","probably","only","want","to","use","it","for","training",".","For","example",",","if","your","original","dataflow","contains","no","randomness","and","produces","the","same","first","datapoint",",","then","after","parallel","prefetching",",","the","datapoint","will","be","produced","``","num_thread","``","times","at","the","beginning",".","Even","when","your","original","dataflow","is","fully","shuffled",",","you","still","need","to","be","aware","of","the","`","Birthday","Paradox","<","https",":","\/\/en.wikipedia.org\/wiki\/Birthday_problem",">","`","_","and","know","that","you","'ll","likely","see","duplicates",".","To","utilize","parallelism","with","more","strict","data","integrity",",","you","can","use","the","parallel","versions","of",":","class",":","`","MapData","`",":",":","class",":","`","MultiThreadMapData","`",",",":","class",":","`","MultiProcessMapData","`","."]
code: def __len__(self):
      return self.threads[0].df.__len__()
  
imports: import atexit
  import pickle
  import errno
  import traceback
  import itertools
  import multiprocessing
  import os
  import sys
  import uuid
  import weakref
  from contextlib import contextmanager
  import zmq
  from six.moves import queue, range
  from ..utils import logger
  from ..utils.concurrency import StoppableThread, enable_death_signal, ensure_proc_terminate, start_proc_mask_signal
  from ..utils.serialize import dumps_once, loads_once
  from .base import DataFlow, DataFlowReentrantGuard, DataFlowTerminated, ProxyDataFlow
label_desc: Use image node_id 3 for calling the MultiThreadRunner obj's underlying member method code with example usage: obj.__len__() and returns: self