title: Upload process blocks other requests AFNetworking 3.0
body: <p>I am trying to upload data with AFNetworking and its successful. no problem with that but the problem is when I am doing it in background than the other requests blocks and doesn't give any response until upload progress finishes. </p>
  
  <p>What I did is I made a singleton and declare AFURLSessionManager in that because I want all current running task.</p>
  
  <pre><code>+ (id)sharedInstance
  {
      static SharedManager *sharedMyManager = nil;
      @synchronized(self) {
      if (sharedMyManager == nil)
          sharedMyManager = [[self alloc] init];
      }
  
      return sharedMyManager;
  } 
  </code></pre>
  
  <p>Let me tell you simple example.. for one controller, I made a request for upload process like below </p>
  
  <p><strong>ViewController1.m</strong></p>
  
  <pre><code>-(void)postImage{
      @try {
          NSMutableDictionary *otherParameters = [[NSMutableDictionary alloc]initWithDictionary:_currentPlaceParameters];
          [otherParameters setObject:[UtitlityManager getUserID] forKey:@"user_id"];
  
          AFHTTPRequestSerializer *serializer = [AFHTTPRequestSerializer serializer];
          NSMutableURLRequest *request =
          [serializer multipartFormRequestWithMethod:@"POST" URLString:URL_UPLOAD_PHOTO_VIDEO parameters:otherParameters constructingBodyWithBlock:^(id&lt;AFMultipartFormData&gt; formData) {
              NSData *thumbImageData = UIImageJPEGRepresentation(dataValue, 0.5);
              [formData appendPartWithFileData:thumbImageData name:@"thumbnail" fileName:@"image.jpg" mimeType:@"image/jpeg"];
          } error:nil];
  
          //show progress bar on window
  
          AFURLSessionManager *manager = [[SharedManager sharedInstance]manager];
          manager.responseSerializer = [AFHTTPResponseSerializer serializer];
          NSURLSessionUploadTask *uploadTask;
          uploadTask = [manager uploadTaskWithStreamedRequest:request progress:^(NSProgress * _Nonnull uploadProgress) {
              // This is not called back on the main queue.
              // You are responsible for dispatching to the main queue for UI updates
              float uploadActualPercentage = uploadProgress.fractionCompleted * 100;
              NSLog(@"Multipartdata upload in progress: %@",[NSString stringWithFormat:@"%f %%",uploadActualPercentage]);
          }
                                            completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
                                                if (error) {
                                                } else {
                                                    NSDictionary *result=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:&amp;error];
                                                    if([[result objectForKey:@"success"] integerValue]==1){
  
                                                    }else{
                                                        [Common showMessageWithMessage:@"Failed, Try again"];
                                                    }
  
                                                }
                                            }];        
          [uploadTask resume];
      } @catch (NSException *exception) {
          NSLog(@"EXC: %@",[exception description]);
      }
  }
  </code></pre>
  
  <p>And than I try to move another view controller and send a request for get other data ... </p>
  
  <p><strong>ViewController2.m</strong></p>
  
  <pre><code>-(void)getData{
      AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
      manager.responseSerializer = [AFHTTPResponseSerializer serializer];
      [manager POST:url parameters:parameters progress:nil success:^(NSURLSessionTask *task, id responseObject) {
          NSDictionary* responseDict = [NSJSONSerialization JSONObjectWithData:responseObject options:kNilOptions error:nil];
  
      } failure:^(NSURLSessionTask *operation, NSError *error) {
  
      }];
   }
  </code></pre>
  
  <p>But this doesn't give response until progress finishes... why so?? </p>
  
  <p>Even I try to set this upload process in dispatch_sync but it won't work ... any suggestion on this???</p>