Skip navigation.
 
mlCoreData multithreading question: @synchronized
FROM : Ruotger Skupin
DATE : Wed Apr 04 19:28:06 2007

Hi,

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).

Does that mean I can do a

@synchronized(myManagedObjectContext)
{
   // .. do stuff
}

or do I have to do a:

[myManagedObjectContext lock];
{
   // .. do stuff
}
[myManagedObjectContext unlock];


Roddi

Related mailsAuthorDate
mlCoreData multithreading question: @synchronized Ruotger Skupin Apr 4, 19:28
mlRe: CoreData multithreading question: @synchronized Shawn Erickson Apr 4, 19:42
mlRe: CoreData multithreading question: @synchronized Jim Correia Apr 4, 19:45