title: Concurrency with OpenGL ES + CoreData
body: <p>I have three tasks:</p>
  
  <ol>
  <li><p>A fetch task. It fetches objects (around 2000 of them) from <code>CoreData</code> and passes the <code>NSManagedObjectIDs</code> to the main thread where they're converted back to <code>NSManagedObjects</code> and stored in an <code>NSArray</code>. This task is of least priority.</p></li>
  <li><p>A computation task. This task iterates through those objects and calculates some values for the object. The values are stored as transient attributes of the <code>NSManagedObject</code> subclass. This task is the 2nd highest priority.</p></li>
  <li><p>An OpenGL ES Drawing Task. This is the drawing loop that updates the UI based on the result of the computation task. This task is highest priority as any slow down will decrease the frame rate and be very apparent when zooming or panning.</p></li>
  </ol>
  
  <p>My issue has been creating a design pattern that allows the first two tasks to do their work while still allowing the OpenGL task to run at maximum frame rate. What inevitably happens if I use GCD queues is that the OpenGL task will be blocked by one of the other two and it will stutter.</p>
  
  <p>I'm thinking that I need to have the OpenGL thread operate on it's own copy of the data, but I'm not sure what that looks like or even if it's the correct solution. Has anyone dealt with this type of issue before? If so, how did you achieve both concurrency and performance?</p>