title: Issue with GCD and too many threads
body: <p>I have an image loader class which provided with NSURL loads and image from the web and executes completion block. Code is actually quite simple</p>
  
  <pre><code>- (void)downloadImageWithURL:(NSString *)URLString completion:(BELoadImageCompletionBlock)completion
  {
      dispatch_async(_queue, ^{
  //    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
          UIImage *image = nil;
          NSURL *URL = [NSURL URLWithString:URLString];
          if (URL) {
              image = [UIImage imageWithData:[NSData dataWithContentsOfURL:URL]];
          }  
          dispatch_async(dispatch_get_main_queue(), ^{
              completion(image, URLString);
          });
      });
  </code></pre>
  
  <p>}</p>
  
  <p>When I replace </p>
  
  <pre><code>dispatch_async(_queue, ^{
  </code></pre>
  
  <p>with commented out </p>
  
  <pre><code>dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
  </code></pre>
  
  <p>Images are loading much faster, wich is quite logical (before that images would be loaded one at a time, now a bunch of them are loading simultaneously).  My issue is that I have perhaps 50 images and I call downloadImageWithURL:completion: method for all of them and when I use global queue instead of _queue my app eventually crashes and I see there are 85+ threads. Can the problem be that my calling dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0) 50 times in a row makes GCD create too many threads? I thought that gcd handles all the treading and makes sure the number of threads is not huge, but if it's not the case is there any way I can influence number of threads?</p>