On Sep 10, 2009, at 8:35 AM, Christopher Wright wrote:
On Sep 10, 2009, at 8:13 AM, Paolo Manna wrote:
our app has since long time dealt with multiple threads and
QCRenderer, and we've worked around the issues that this implied (see
Technical Q&A 1538 -
http://developer.apple.com/mac/library/qa/qa2008/qa1538.html ).
Now, we're intrigued by the power and simplicity that Grand Central
Dispatch would bring to our code: still, it's my understanding
that we
surrender the tight control over which-thread-does-what, that's vital
to avoid the #1538 issues.
Admittedly, I haven't explored GCD enough to know if there are
ways to
work the way we need: has anyone tried this, and how does that come
out? Or, is the issue solved in Snow Leopard?
My current experience is that QuickTime issues have not been
solved. So movie-using compositions may be problematic (checking
under the hood, it looks like they maybe switched to QuickTimeX
internally, so maybe there's some hope?) -- as usual, doing a test
will give you usable results faster than asking on the lists :/
You still have control over which threads do what, in certain cases
with GCD -- for example, dispatch_get_main_queue() is always going
to happen on the main thread (of course, you lose concurrency when
you use this queue). I'm not sure if dispatch groups keep threads
around, or if you have to keep the queue "full" (always busy, never
idle) to keep the thread around.
I'd highly recommend doing some tests, and firing up instruments to
see if you encounter any problems (exceptions/crashes, or memory
leaks) -- dispatch stuff is cake to add, so testing shouldn't be
too painful.
That said, if you've already worked around the threading issues,
and already have a successful multithreaded implementation, I'm not
sure what benefits you'll get from GCD (other than automatic
threadpool management, which is pleasant but not a show-stopper).
I don't know your usage/needs, so maybe you would benefit, but
you'll have to profile to figure that out.
There was also a GCD discussion on the Xcode mailing list earlier
today. The gist of it was that the OP wanted to use GCD but also have
a solution that works on older OS versions. The last message in the
thread (written by Chris Hanson) might be relevant:
You can get many of the same advantages [of GCD] using NSOperation,
and write code that runs on Mac OS X 10.5 and 10.6 (and iPhone).
Your code will automatically take advantage of GCD on Snow
Leopard, since NSOperation is built atop it.
So if you do elect to move away from straight threads, using
NSOperation might be a better way to do it unless you're willing to
require 10.6 or later for your app's users.
steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]