title: Patterns for handling an event firing from another thread
body: <p>Suppose I have two threads.  On one thread, I'm performing a sequence of jobs.  On the other thread I'm waiting for user input to control those jobs (i.e., skip to the next job).  For example (pseudo-C#):</p>
  
  <pre><code>public class Worker {
  
      public List&lt;Job&gt; Jobs { get; set; }
  
      public Worker(Controller anotherThread) {
          anotherThread.SkipJobRequested += OnSkipJobRequested;
      }
  
      public DoWork() {
          foreach (Job job in Jobs) {
              // Do various work...
          }
      }
  
      // Event that fires on Controller thread
      public void OnSkipJobRequsted(Object sender, EventArgs args) {
          // Somehow skip to the next job
      }
  }
  </code></pre>
  
  <p>I'm uncertain how I should handle skipping to the next job.  One possibility that occurs to me would be to have an instance variable (like, <code>IsSkipRequested</code>) that I set when a skip is requested, and check it at various junctures within <code>DoWork()</code>.</p>
  
  <p>Do any other patterns exist that I could use to handle this event? </p>