Re: CoreData huge memory usage - is this right ?
Re: CoreData huge memory usage - is this right ?
- Subject: Re: CoreData huge memory usage - is this right ?
- From: Ben Trumbull <email@hidden>
- Date: Wed, 19 Dec 2007 16:29:37 -0800
At 7:21 AM -0800 12/19/07, email@hidden wrote:
> MOC are not particularly expensive to create, so if you cache your
PSC, you can use different MOCs for different working sets or
> distinct operations.
Just to be very clear, Ben: I read this to mean that it's fine to
have multiple MOC's in one thread for a given PSC. Right? MOCs
should not be shared across multiple threads (per documentation), but
I gather that the converse is false.
Absolutely. You can use as many MOCs per PSC as you like, but life
is best if a MOC is only used by the thread that created it.
One might diagram a PSC <->> MOC relationship, a process <->> PSC
relationship, and a thread <->> MOC relationship.
It is technically possible to share a MOC between threads, but this
requires manually locking the MOC, and I haven't seen any decent
examples where a developer was sufficiently rewarded for the effort.
Sharing a PSC between threads also requires manual locking, but this
is pretty easy, and directly messaging the PSC is rare (compared to
working with MOs and MOCs)
ADC has available for download the 10.5 debug libraries and
frameworks, which enforce our threading expectations with assertions.
--
-Ben
_______________________________________________
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