Re: CoreData multithreading question: @synchronized
Re: CoreData multithreading question: @synchronized
- Subject: Re: CoreData multithreading question: @synchronized
- From: Jim Correia <email@hidden>
- Date: Wed, 4 Apr 2007 13:45:30 -0400
On Apr 4, 2007, at 1:28 PM, Ruotger Skupin wrote:
a short CoreData question. according to the manual:
Managed objects themselves are not thread safe. In order to work
with a managed object across different threads, you should lock its
context (see NSLocking).
The test you quoted from the documentation refers the the NSLocking
protocol, which is wholly separate from @synchronize'd regions.
Furthermore, the same documentation says, quite explicitly:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdMultiThreading.html
For locking, you should use the NSLocking methods on managed object
context
and persistent store coordinator instead of implementing your own
mutexes.
Finally, you may wish to consult the list archives for previous
advice that has been given about this topic. In particular:
http://lists.apple.com/archives/cocoa-dev/2007/Mar/msg00739.html
Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden