Re: Smooth OpenGL animation possible, even if main thread blocks?
Re: Smooth OpenGL animation possible, even if main thread blocks?
- Subject: Re: Smooth OpenGL animation possible, even if main thread blocks?
- From: Markus Hanauska <email@hidden>
- Date: Mon, 28 Jun 2010 13:55:09 +0200
On Friday, 2010-06-25, at 21:18, vincent habchi wrote:
> As far as my experience goes, it was perfectly possible to update a CALayer from a background thread as long as you make this thread run its own runloop. That's what I did some time ago before reverting to the classical method for the sake of complexity.
"Possible" or "Allowed"? ;-)
It is also possible to use Cocoa UI objects from different threads; at least if you do it carefully, you might get away with that. However, I doubt this is really allowed and if it stops working, Apple will say "We told you not to...". Considering that the future of processing is more and more cores (virtual or physical ones), it is pretty unfortunate that Cocoa is so little thread-safe and that UI is still often bound to main thread. Apple seems to believe that UI operations and event handlers are always very light weight and that everything else is a calculation task you can perform on a background thread. This only holds true for very simply applications and shuffling data around between threads is far from zero cost.
--
Markus Hanauska
_______________________________________________
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