title: Why performSelector:onThread: is not good?
body: <p>Just found in <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html#//apple_ref/doc/uid/10000057i-CH15-SW30" rel="nofollow">Apple docs:</a></p>
  
  <blockquote>
    <p><strong>Note:</strong> Although good for occasional communication between threads, you should not use the <code>performSelector:onThread:withObject:waitUntilDone:</code> method for time critical or frequent communication between threads.</p>
  </blockquote>
  
  <p>Why is it so? How much is "frequent"?</p>
  
  <p>I have an app with a lot of threads and a lot of stuff happening in main thread (heavy JavaScript, frequent Ajax queries in a WebKit). On Yosemite, I started to experience huge problems in combination of several (say, 10) file downloads (<code>NSURLDownload</code>s) plus the WebKit GUI (required to run in the main thread).</p>
  
  <p>File downloads cannot "live" long with a WebKit heavily loaded by JavaScript. At some point, all network requests start returning timeout (error -1001) until the app quits.</p>
  
  <p>And I widely use <code>performSelector:onThread:withObject:waitUntilDone:</code>, e.g. to notify UI about the download progress. This can happen many times per second. Can it be the problem?</p>
  
  <p>P.S. Unfortunately, I'm not allowed to show the whole source code...</p>