Re: NSOperation and threadDictionary
Re: NSOperation and threadDictionary
- Subject: Re: NSOperation and threadDictionary
- From: Rick Mann <email@hidden>
- Date: Wed, 22 Sep 2010 17:03:58 -0700
On Sep 22, 2010, at 17:00:13, Roland King wrote:
>>
>> Seems reasonable. The only problem I foresee is that if the system is recycling threads for subsequent NSOperations, I don't think you'll get the NSThreadWillExitNotification, because the thread itself never exits.
>>
>
> Do you care? In my case I only care that the MOC is appropriate for the thread I'm on, I don't need it to be empty and brand new, if it's primed with data that's actually a bonus for me. If you do then you might want to add another method to the singleton to explictly destroy the MOC for your thread, and call it after you save data or just before the method you're running on the queue exits so the next guy will definitely get a fresh one.
For sure I care. I want a fresh MOC, and I wanted to avoid having new classes written having to make sure of this (many different engineers come and go on this project; the more stuff they have to keep track of or know, the more likely they are to introduce errors).
It can clearly be done, we just have an architecture with a bit of a hole because of the inability to "just use" the TLS.
--
Rick
_______________________________________________
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