title: Launching a boost fiber in thread 1 from thread 2
body: <p>I have a main linux thread (th1) that runs a number of boost fibers that are scheduled using the boost priority scheduler.</p>
  <p>Every so often, I would like to launch a fiber from another thread (th2) that will run in th1 and be scheduled along with the other th1 fibers.  The code I use to launch fibers in th1 looks like:</p>
  <pre><code>void launchFiber()
  {
  boost::fibers::use_scheduling_algorithm&lt; priority_scheduler &gt;()
  boost::fibers::fiber *fib = new boost::fibers::fiber(fb_fiberFunction);
  priority_props &amp; props( fib-&gt;properties&lt; priority_props &gt;() );
  props.set_priority(FiberPriorityValue);
  props.name = &quot;Fiber Name&quot;;
  fib-&gt;detach();
  }
  </code></pre>
  <p>The launch code works fine when I call the launchFiber function from th1 but it does not work when I call it from th2--it looks like the fiber is not added to the th1 fiber queue.  I have added a mutex to the th1 priority_scheduler routine to protect the fiber queue but this doesn't seem to help.</p>
  <p>It seems to me that I don't really understand how the fiber system is working when there is more than one thread involved.  I have tried to look at the library source code but it is not really clear to me.</p>
  <p>My guess is that this would be simple if I understood it correctly.  Could someone provide an example of how I might do this.</p>