title: Is [NSOperationQueue mainQueue] a serial queue?
body: <p>The following method uploads some images to a remote server. I want them to be upload independent of each other (in parallel).</p>
  
  <pre><code>- (void)startUploadProcess {
      for (int i = 0; i &lt; [imageNames count]; i++) {
          NSBlockOperation *blockOp = [NSBlockOperation blockOperationWithBlock:^{
              [GlobalsFuncs uploadImageToServer:[[NSImage alloc] initWithContentsOfURL:[imagePaths objectAtIndex:i]]  forSessionID:[[family SessionID] stringValue]  withFilename:[imageNames objectAtIndex:i]];
          }];
  
          blockOp.completionBlock = ^{
              [[NSOperationQueue mainQueue] addOperationWithBlock:^{
                  [self afterUploadCompletion:i];
              }];
          };
          [bgQueue addOperation:blockOp];
      }
  }
  
  - (void)afterUploadCompletion:(NSInteger)pageNumber {
      NSLog(@"%ld for sessionID : %@", (long)pageNumber, family.SessionID);
      imagesUploaded++;
      [progressIndicator incrementBy:progressDelta];
  }
  </code></pre>
  
  <p>As you can see from the code above, I'm adding a call to the <code>afterUploadCompletion</code> method for each image. In that method, I'm incrementing an integer that is a class instance variable. My question is if my code will ever cause a race condition? Basically, what I'm asking is if everything in the <code>mainQueue</code> is executed serially? 
  Also, how can I make the <code>NSOperationQueue *bgQueue</code> a parallel queue? I want blocks added to this queue to NOT wait for previous operations to complete.</p>
  
  <p>Thanks a lot for your help!</p>