• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CoreData multithreading question: @synchronized
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData multithreading question: @synchronized


  • Subject: CoreData multithreading question: @synchronized
  • From: Ruotger Skupin <email@hidden>
  • Date: Wed, 4 Apr 2007 19:28:06 +0200

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

_______________________________________________

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


  • Follow-Ups:
    • Re: CoreData multithreading question: @synchronized
      • From: Jim Correia <email@hidden>
    • Re: CoreData multithreading question: @synchronized
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: Bindings + contents of an array. No dice, for newb.
  • Next by Date: CoreData multithreading question: locking multiple contexts
  • Previous by thread: [Moderator] EOT Re: embedd artworks..
  • Next by thread: Re: CoreData multithreading question: @synchronized
  • Index(es):
    • Date
    • Thread