On Feb 17, 2011, at 09:15, Gabriel Zachmann wrote:

> Thanks a lot for your response, Tomas!
> 
>> since no one replied so far, I’d take a try. I’m not much familiar with 
>> desktop Cocoa, but on iOS we have to be careful to keep longer actions from 
>> the main thread, since delays in the main thread block the UI. Isn’t this 
>> about the same issue?
> 
> Good question. One problem is that I have not understood a fundamental 
> property of Core Animation.
> I have always assumed that the animation, once I have set it up, is done by 
> the OS / Core Animation in the background, i.e., in a separate thread.
> Is that correct?
> If yes, then wouldn't that mean that moving my image loading into a separate 
> thread would *not* help at all?
> If no, then exactly when / where is the animation performed?
> 
> You see, my understanding of the interplay between Core Animation and my 
> application is still a mess ;-}
> So any light anybody can shed on it will be highly appreciated.
> 
>> Image loading would be the first thing I would move into a background 
>> thread. Can you use GCD? It’s a perfect fit for such producer/consumer tasks.
> 
> Please explain "GCD".

GCD is Grand Central Dispatch, the "brain" that the OS uses to execute all 
running processes. You might want to read on that subject in the developer 
documentation. You use NSOperationQueue to basically run a thread that will be 
scheduled and processed by GCD, as opposed to 
"detachNewThreadSelector:toTarget:withObject:" (and other varieties on the same 
theme) which just forks a new executing thread for your app. There are some 
advantages to use GCD as opposed to detach a new thread in your app and you 
will learn them by reading the doc on the subject.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin                                 
http://www.nemesys-soft.com/
Logiciels Nemesys Software                                      
laur...@nemesys-soft.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to