• 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 Multithreading question about save
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core-Data Multithreading question about save


  • Subject: Re: Core-Data Multithreading question about save
  • From: "Hamish Allan" <email@hidden>
  • Date: Thu, 22 May 2008 00:00:06 +0100

On Wed, May 21, 2008 at 11:36 PM, Dex Morgan <email@hidden> wrote:

> This link actions happend in the main thread (so inside the main object
> context) and the app can't see objects inserted into the second
> managedobject until I perform a -save: to it.
> However it seems to be a damn expensive operation (a save for each inserted
> object I mean) and I think it's not the right way to perform my target.

If you need to create relationships between objects in two different
contexts, you need to synchronize those contexts, which is inherently
expensive.

Do you really need to do this after every object inserted? Could you
do it in bulk?

Do you really need to do the inserts on a separate thread? Could you
have your worker thread call
performSelectorOnMainThread:withObject:waitUntilDone: and have the
main thread perform the inserts at the end of each run loop iteration?

Hamish
_______________________________________________

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:
    • Re: Core-Data Multithreading question about save
      • From: Dex Morgan <email@hidden>
References: 
 >Core-Data Multithreading question about save (From: Dex Morgan <email@hidden>)
 >Re: Core-Data Multithreading question about save (From: "Hamish Allan" <email@hidden>)
 >Re: Core-Data Multithreading question about save (From: Dex Morgan <email@hidden>)

  • Prev by Date: Re: How to schedule an autonomous (SMTP/FAX) service.
  • Next by Date: Re: Cocoa et al as HCI usability problem
  • Previous by thread: Re: Core-Data Multithreading question about save
  • Next by thread: Re: Core-Data Multithreading question about save
  • Index(es):
    • Date
    • Thread