I just spent some time tracking down a pretty sneaky issue I had, and am 
curious of the official policy with QC.

Is it safe to, on multiple threads, concurrently load QCCompositions from disk, 
and init QCRenderers?

I saw what looked like machine specific deadlocks* in QC when I had a few 
render threads all attempt to init multiple QC Renderers at the same time. Only 
when I specifically serialized initialization did the deadlock go away. I would 
never get past initting a QCRenderer, and the specific threads loading 
QCRenderers would sit deadlocked on 

                  830 -[QCComposition _makePatch]
                     830 QCPatchFromCompositionWithOptions
                       830 _PatchFromComposition
                         830 -[QCPatch(Override) setState:]
                           830 -[GFGraph setState:]
                             830 -[GFGraph(Private) _loadState:]
                               830 -[QCRenderInImage setState:]
                                 830 -[QCPatch(Override) setState:]
                                   830 -[GFGraph setState:]
                                     830 -[GFGraph(Private) _loadState:]
                                       830 +[GFNodeManager 
instantiateNodeWithClassName:identifier:]
                                         830 -[QCNodeManager 
instantiateNodeWithName:]
                                           830 -[GFNodeManager 
instantiateNodeWithName:]
                                             830 pthread_mutex_lock
                                               830 semaphore_wait_signal_trap

(in multiple threads).

I could never re-create this lock on my two development machines, but a slower 
Mac Mini was able to deadlock every time.

Is it safe to init concurrently like this? While i've "solved" my issue via 
dispatch_semaphore (so useful, thanks again Chris for the pointer), its not 
clear this should be a problem. More curious than anything else, and maybe a 
warning for those looking to do the same or running into similar issues.

Thank you. 

* of course, it could just be that I never got the timing just right on my test 
systems...  _______________________________________________
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]

Reply via email to