• 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
Re: Core data fetch and multithreading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core data fetch and multithreading


  • Subject: Re: Core data fetch and multithreading
  • From: Hunter Hillegas <email@hidden>
  • Date: Mon, 22 Nov 2010 07:58:07 -0800

I think someone somewhere told me that if you create a MOC on the main thread, there's some special runloop integration that is included, hence one of the reasons it's important to not create one on the main thread and then pass it around.

This is also important to keep in mind re: NSOperation, since it's init is called on the main thread.

http://www.duckrowing.com/2010/03/11/using-core-data-on-multiple-threads/

On Nov 22, 2010, at 12:16 AM, Quincey Morris wrote:

> I think maybe you have more design options here. For example, you can [in principle, I think] multithread with a single MOC without locks if you pass "ownership" of the MOC around between threads that make changes, so that ownership serializes access. That requires the ownership passing to be thread safe, and you already have [I think] the perfect mechanism for that: GCD. You'd probably also want to break down your background operations so that enumeration of the relationship doesn't take place within a single GCD block execution, but where each block execution is one iteration of the enumeration. (Isn't that more GCD-like anyway?)

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Obtaining all points on a line segment
      • From: Cody Garvin <email@hidden>
References: 
 >Core data fetch and multithreading (From: vincent habchi <email@hidden>)
 >Re: Core data fetch and multithreading (From: Quincey Morris <email@hidden>)
 >Re: Core data fetch and multithreading (From: vincent habchi <email@hidden>)
 >Re: Core data fetch and multithreading (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: unit test exit's abnormally with code 5
  • Next by Date: [NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5
  • Previous by thread: Re: Core data fetch and multithreading
  • Next by thread: Obtaining all points on a line segment
  • Index(es):
    • Date
    • Thread