Re: NSOperation and threadDictionary

2010-09-23 Thread Julien Poissonnier
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 the

Re: NSOperation and threadDictionary

2010-09-22 Thread Rick Mann
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 seems that

Re: NSOperation and threadDictionary

2010-09-22 Thread Kyle Sluder
On Wed, Sep 22, 2010 at 11:31 AM, Rick Mann rm...@latencyzero.com 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

Re: NSOperation and threadDictionary

2010-09-22 Thread Rick Mann
not readily available, but won't be too hard to make so. If the NSOperation could've relied on getting a pristine threadDictionary, that would've been very convenient (more specifically, if it could rely on the NSOperation infrastructure to clean up the threadDictionary when the NSOperation

Re: NSOperation and threadDictionary

2010-09-22 Thread Roland King
not. The operation is actually not readily available, but won't be too hard to make so. If the NSOperation could've relied on getting a pristine threadDictionary, that would've been very convenient (more specifically, if it could rely on the NSOperation infrastructure to clean up the threadDictionary

Re: NSOperation and threadDictionary

2010-09-22 Thread Roland King
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

Re: NSOperation and threadDictionary

2010-09-22 Thread Rick Mann
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

Re: NSOperation and threadDictionary

2010-09-22 Thread Rick Mann
not. The operation is actually not readily available, but won't be too hard to make so. If the NSOperation could've relied on getting a pristine threadDictionary, that would've been very convenient (more specifically, if it could rely on the NSOperation infrastructure to clean up the threadDictionary when

NSOperation and threadDictionary

2010-09-21 Thread Rick Mann
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