• 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: Deadlock during NSCache flush
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deadlock during NSCache flush


  • Subject: Re: Deadlock during NSCache flush
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 21 Oct 2013 22:22:30 -0700

On Oct 21, 2013, at 8:09 PM, Seth Willits <email@hidden> wrote:

> What reason is there for the documents to have a strong reference to the database?

The database object has all the core functionality including the underlying data storage engine. The document calls into the database to do the real work like loading or saving properties. So conceptually the connection to the database can’t be weak, because if it gets nil’ed out the document is busted and a lot of its methods will fail.

I guess you could answer that by saying that the API client should hold onto a strong reference to the database in order to keep using it, and if they let the database object drop on the floor (so to speak) they deserve whatever they get. That still seems kludgy to me, but I’ve been working with ref-counted systems for a long time* and I know very well that kludginess is sometimes needed to avoid cycles…

—Jens

* Jeebus, I think it’s been 29 years. I started using Smalltalk-80 as a summer intern in 1984; its garbage collector was ref-counted and couldn’t collect cycles.
_______________________________________________

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: 
 >Deadlock during NSCache flush (From: Jens Alfke <email@hidden>)
 >Re: Deadlock during NSCache flush (From: Ken Thomases <email@hidden>)
 >Re: Deadlock during NSCache flush (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: Deadlock during NSCache flush
  • Next by Date: Helping Arc with: "PerformSelector may cause a leak because its selector is unknown"
  • Previous by thread: Re: Deadlock during NSCache flush
  • Next by thread: Re: Deadlock during NSCache flush
  • Index(es):
    • Date
    • Thread