On Sep 22, 2010, at 12:52 AM, Rick Mann wrote:
> Does iOS (and Mac OS X) clean up thread-local storage upon the completion of
> an NSOperation? It seems dangerous to rely on every operation to clean up its
> own mess. It also seems that an NSOperation should be able to pretend that it
> owns t
On Sep 22, 2010, at 16:45:51, Roland King wrote:
> I did something similar to this a couple of weeks ago - posted about it but
> under a heading about NSManagedObjectWillSave notifications.
>
> If you have a singleton with a method which returns an MOC, you can store the
> MOCs you create in
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 ca
>
> 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 t
I did something similar to this a couple of weeks ago - posted about it but
under a heading about NSManagedObjectWillSave notifications.
If you have a singleton with a method which returns an MOC, you can store the
MOCs you create in a CFDictionary in the singleton with the NSThread as key.
Th
I knew that wasn't clear. We have a method on the singleton that returns an
MOC. If the thread is the main thread, it returns the "main" MOC. If not, it
creates a new MOC, and returns that. Then we subsequently pass that MOC around
to the various methods responsible for doing the work of creatin
On Wed, Sep 22, 2010 at 11:31 AM, Rick Mann wrote:
> Pity. We have a singleton object that creates a subclass of NSOperation,
> which then calls back a method on the singleton that's intended to be run on
> a separate thread (provided indirectly by the NSOperation). That singleton
> needs it's
On Sep 22, 2010, at 11:17:25, Julien Poissonnier wrote:
>
> On Sep 22, 2010, at 12:52 AM, Rick Mann wrote:
>
>> Does iOS (and Mac OS X) clean up thread-local storage upon the completion of
>> an NSOperation? It seems dangerous to rely on every operation to clean up
>> its own mess. It also se
Does iOS (and Mac OS X) clean up thread-local storage upon the completion of an
NSOperation? It seems dangerous to rely on every operation to clean up its own
mess. It also seems that an NSOperation should be able to pretend that it owns
the thread on which it's running, and not have to worry ab