title: Troubleshoot Core Data Deadlocks?
body: <p>I have an iOS app that pulls user data down from a web service and saves it to a sqlite backed core data store.  While this is also going on I'm taking the url for the user's avatar and saving the image locally into core data as the download of each image becomes available.</p>
  
  <p>Each of these are performed on their own thread with their own managed object context but with the same shared persistent store coordinator.</p>
  
  <p>When there are just a few items being pulled down, this works great, but as we approach 100 items or so I get frequent deadlocks on the initial load of data.  When I pause the debugger I see the different threads usually both waiting on an executeFetchRequest.</p>
  
  <p>I turned on the sql debug in my scheme and according to the console output the fetches complete, but the threads never continue.</p>
  
  <p>What else can I use or look at to examine why these are deadlocking or how I can prevent these deadlocks from occurring?</p>