• 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 Threading docs/advice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData Threading docs/advice?


  • Subject: CoreData Threading docs/advice?
  • From: Jim Correia <email@hidden>
  • Date: Wed, 9 Nov 2005 16:55:41 -0500

As Bill B. has said in the past, the best threading advice is to avoid using threads. I agree. That said, suppose I do need to do work in a secondary thread...

Is there a place which summarizes the rules for using CoreData from multiple threads?

Over time, the advice has been:

One managed object context per thread.
Don't pass objects, just object IDs between threads.

Are there other considerations?

If you have to use a MOC on multiple threads, there are the lock methods.

The persistent store coordinator documentation says "If you want to use multiple threads for different write operations you use multiple coordinators. Note that if multiple threads work directly with a coordinator, they need to lock and unlock it explicitly."

I rarely use a persistent store coordinator directly, but indirectly through multiple managed object contexts (at this time, all on the main thread.) If I am only going through the MOCs, do I have to do any locking and unlocking of the persistent store coordinator?

Thanks,
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Getting NSXMLDTD to initialize
  • Next by Date: Re: Getting NSXMLDTD to initialize
  • Previous by thread: Re: Getting NSXMLDTD to initialize
  • Next by thread: Need help finding memory leak.
  • Index(es):
    • Date
    • Thread