title: Which parts of UIKit, Core Graphics, Core Animation, OpenGL are allowed on non main-thread?
body: <p>In my OpenGL-ES 1.1 based app, I'm using <code>CALayer</code>s as a source for OpenGL textures. Those <code>CALayer</code>s comprise of <code>CGImage</code>s and text rendered through CoreGraphics. Another OpenGL texture source is a screenshot of a <code>UIView</code> taken using <code>-[CALAyer renderInContext:]</code> and <code>UIGraphicsGetImageFromCurrentImageContext</code>. Currently, I'm running completely on the main thread.</p>
  
  <p>The latter case in particular is pretty bad because it halts the OpenGL rendering for the whole time it takes to create the <code>UIView</code> and its screenshot.</p>
  
  <p>Now I'm considering to move the OpenGL code into a separate thread hoping to get around this blocking. Ideally, the screenshot would be taken on a different thread (main thread if needed) than the OpenGL rendering.</p>
  
  <p>I wasn't able to find a complete coverage in the documentation about what requires running on the main thread and what not. I found some comments in the <a href="http://developer.apple.com/library/ios/#releasenotes/General/WhatsNewIniPhoneOS/Articles/iPhoneOS4.html%23//apple_ref/doc/uid/TP40009559-SW29" rel="nofollow">iOS 4 release notes</a>, and some comments in specific UIKit methods but I'm missing the complete picture.</p>
  
  <p>The code runs on iOS 4.x or higher.</p>