I know the CoreData is not thread safe, and I need one MOC per thread, and I am using two threads (one to process incoming updates, one to feed the UI) but... Is it ok to just read an object on a completely different thread like:
NSManagedObject *mo = fetch some object
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
loop over the objects in a relation, fetch some data and cache it....
});
Where DISPATCH_QUEUE_PRIORITY_BACKGROUND
could be any one of DEFAULT, LOW, HIGH. I'm getting some strange behaviour and perhaps I should not be doing any background work, even if its read-only, with my managed object.
If I should not be doing this, any suggestions on how to do it? Create another temporary MOC just for this dispatch_async
block?