title: Why do two concurrent queues created by DISPATCH_QUEUE_CONCURRENT not running concurrently?
body: <p>To execute two tasks concurrently, I made two concurrent queues and dispatched some blocks to both the queues.</p>
  
  <p>Here is what I am doing in main thread</p>
  
  <pre><code>-(IBAction)btn_Pressed:(id)sender
  {
      dispatch_queue_t queue_a = dispatch_queue_create("com.gcd_demoA", DISPATCH_QUEUE_CONCURRENT);
      dispatch_queue_t queue_b = dispatch_queue_create("com.gcd_demoB", DISPATCH_QUEUE_CONCURRENT);
  
      dispatch_sync(queue_a, ^{
          NSLog(@"A - 1");
      });
  
       dispatch_sync(queue_a, ^{
          NSLog(@"A - 2");
      });
  
      dispatch_sync(queue_a, ^{
          NSLog(@"A - 3");
      });
  
      dispatch_sync(queue_b, ^{
          NSLog(@"B - 1");
      });
  
      dispatch_sync(queue_b, ^{
          NSLog(@"B - 2");
      });
  
      dispatch_sync(queue_b, ^{
          NSLog(@"B - 3");
      });
  }
  </code></pre>
  
  <p>But, surprisingly I always get the following output:</p>
  
  <pre><code>A - 1  
  A - 2  
  A - 3  
  B - 1  
  B - 2  
  B - 3  
  </code></pre>
  
  <h2>Why these two concurrent queues don't execute concurrently ?</h2>
  
  <p>Here is what Apple document says (<a href="https://developer.apple.com/library/mac/documentation/performance/reference/gcd_libdispatch_ref/Reference/reference.html#//apple_ref/c/func/dispatch_queue_create" rel="nofollow noreferrer">reference</a>): </p>
  
  <blockquote>
    <p>Blocks submitted to a serial queue are executed one at a time in FIFO order. Note, however, that blocks submitted to independent queues may be executed concurrently with respect to each other. Blocks submitted to a concurrent queue are dequeued in FIFO order but may run concurrently if resources are available to do so.</p>
  </blockquote>
  
  <p>So, as per this statement, in my case, the blocks of queue B should execute regardless of what's happening in queue A. Means, totally independent than queue A. But, why the blocks of queue B don't start their execution until all blocks of queue A finish.</p>
  
  <p>Correct me if something has been misunderstood.</p>