The best way is for the threads to own the objects needed to complete the thread, doing whatever it does, until it can stop processing and shut down as quickly as possible.
In non-GC, this means -retainthat the stream -releaseis complete. For GC, this is simply a solid reference to the desired object (s).
If there is any lengthy processing that should continue and should complete before the document is closed, then discard the progress bar and leave the document modal until completed (both Aperture and iPhoto do just that).
source
share