> On 29 Jul 2015, at 15:35, Trygve Inda <cocoa...@xericdesign.com> wrote: > >> >> “Setter methods on queue-based managed object contexts are thread-safe. You >> can invoke these methods directly on any thread” >> >> https://developer.apple.com/library/mac/documentation/Cocoa/Reference/CoreData >> Framework/Classes/NSManagedObjectContext_Class/index.html >> > > > In Apple's example, they use two different contexts, each with their own > NSPersistentStoreCoordinator. But the NSPersistentStoreCoordinators each > point to the same store file URL. > > Where is it documented that this works? > > If the NSPersistentStoreCoordinator instances are separate, how does it > actually work when they are both writing to the same store (potentially at > the same time)? > > All Apple's notes say is: > > To ensure that the application can remain responsive during this operation, > the view controller employs a second coordinator to manage interaction with > the persistent store. It configures the coordinator to use the same managed > object model and persistent store as the main coordinator vended by the > stack controller.
I can’t recall where it’s documented specifically, but this is supported. The PSCs then rely on SQLite's locking of the file on disk to manage access to it. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com