• 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 nested managed object contexts and frequent deadlocks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data nested managed object contexts and frequent deadlocks


  • Subject: Re: Core Data nested managed object contexts and frequent deadlocks
  • From: Chris Hanson <email@hidden>
  • Date: Fri, 13 Jan 2012 13:45:23 -0800

On Jan 13, 2012, at 12:39 AM, Michael Link wrote:

> the docs seem to indicate that using a main thread concurrency type MOC on the main thread without performBlock: is fine.

It is, otherwise you couldn't (say) bind to a managed object you fetched via a main-queue context on OS X.  What OS version(s) are you seeing this with?

> It appears that the private queue is waiting on the PSCs lock which the child context on the main thread has already locked. It appears that the child context (while holding the PSCs lock) is trying to dispatch_sync to the parent context and thus they are both waiting for each other.
>
> Is PriveQueue -> MainQueue a supported configuration? It seems most people still have the parent context on the main thread.

Using a parent private-queue context and a child main-queue context is actually a good design.  I'm not sure about your deadlock; does it still occur if you don't use -performBlock: on your main-queue context but just interact with it directly?

  -- Chris

_______________________________________________

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 nested managed object contexts and frequent deadlocks
      • From: Michael Link <email@hidden>
References: 
 >Core Data nested managed object contexts and frequent deadlocks (From: Michael Link <email@hidden>)

  • Prev by Date: Child windows appear to move when entering full-screen mode / how to detect full-screen transition
  • Next by Date: Re: Core Data nested managed object contexts and frequent deadlocks
  • Previous by thread: Core Data nested managed object contexts and frequent deadlocks
  • Next by thread: Re: Core Data nested managed object contexts and frequent deadlocks
  • Index(es):
    • Date
    • Thread