title: understanding a qthread subclass's run method and thread context
body: <p>i have an encoder class with lots of methods . this is a subclass of  Qthread. i am new to multi-threading and </p>
  
  <blockquote>
    <p>trying to understand how this class is
    threading its methods</p>
  </blockquote>
  
  <p>... i understand to thread a method it has to be in a subclass of qthread. and the run of this implements the threaded code for this class. And the thread starts  only when a call to start method on the object of this class is made. </p>
  
  <blockquote>
    <p><em>Question :</em>  firstly what do you infer
    from the this run implementation</p>
  </blockquote>
  
  <pre><code>void Encoder::run(void)
  {
      VERBOSE(VB_DEBUG, "Encoder::run");
  
      if (WILL_PRINT(VB_DEBUG))
          print_stats_timer_id = QObject::startTimer(kEncoderDebugInterval);
      health_check_timer_id = QObject::startTimer(kEncoderHealthCheckInterval);
  
      if (init())
          exec();
      else
          VERBOSE(VB_ERROR, "Encoder::run -- failed to initialize encoder");
  
      QObject::killTimer(health_check_timer_id);
      if (print_stats_timer_id)
          QObject::killTimer(print_stats_timer_id);
  
      cleanup();
  }
  </code></pre>
  
  <blockquote>
    <p><em>Question:</em> what does thread context mean in
    relation to its methods .</p>
  </blockquote>
  
  <p>also</p>
  
  <blockquote>
    <p><em>Question:</em> what would happen If a method of this
    class is called before this class's
    thread has started</p>
  </blockquote>