• 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: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).


  • Subject: Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).
  • From: Michael Ash <email@hidden>
  • Date: Sun, 22 Feb 2009 18:33:10 -0500

On Sun, Feb 22, 2009 at 3:46 PM, Luke Evans <email@hidden> wrote:
> My discovery (and life is full of them, so nothing particularly unusual
> here) is that the practicality of doing the locking appears to 'tip over' if
> you have binding to your Core Data.  I have my main thread, and one
> background thread trawling for files - both scrupulously locked on the MOC
> around _any_ access, i.e. even reading a property.

No you don't. You're locking around any *explicit* access to a
property. Meanwhile your implicit accesses due to bindings are going
unlocked, and your code fails, hard.

It's a basic tenet of multithreading. If you're taking an unsafe
datastructure, and making it safe by synchronizing all accesses with
locks, you *cannot* give *any* references to that data structure to
outside code.

Bindings will not follow your locking protocol, so you can't let them
touch your context with this approach.

Mike
_______________________________________________

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

References: 
 >Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock). (From: Luke Evans <email@hidden>)
 >Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock). (From: "Clark S. Cox III" <email@hidden>)
 >Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock). (From: Luke Evans <email@hidden>)
 >Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock). (From: mmalc Crawford <email@hidden>)
 >Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock). (From: Luke Evans <email@hidden>)

  • Prev by Date: Re: How to get the "white shadow" effect when drawing NSStrings?
  • Next by Date: Re: Name to PSN
  • Previous by thread: Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).
  • Next by thread: Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).
  • Index(es):
    • Date
    • Thread