title: iOS AVFoundation and Multithreading
body: <p>In every sample code of Apple's AVFoundation demonstrations, a seperate queue for all the session tasks.</p>
  
  <pre><code>dispatch_queue_t sessionQueue = dispatch_queue_create("session queue", DISPATCH_QUEUE_SERIAL);
  </code></pre>
  
  <p>This is also used for observing focus changes, exposure changes, whitebalance changes, ect:</p>
  
  <pre><code>- (void)viewWillAppear:(BOOL)animated
  {
       [super viewWillAppear:animated];
       dispatch_async([self sessionQueue], ^{
            [self addObservers];
            [[self session] startRunning];
       });
  }
  
  - (void)viewDidDisappear:(BOOL)animated
  {
       dispatch_async([self sessionQueue], ^{
            [[self session] stopRunning];
            [self removeObservers];
       });
       [super viewDidDisappear:animated];
  
  }
  </code></pre>
  
  <p>When I followed this, everything was smooth, until I adopted 'GPUImage', a 3rd party api.  I was informed  that multi-threading or seperate queueing is not needed for this api since it's all taken care of within. So I took the 'sessionQueue' completely out.</p>
  
  <p>However, now my app runs really choppy, and I think it's due to main queue having told to handle most branched-off tasks.</p>
  
  <p>Can I have a seperate queue just for observing self.videoCamera changes? Would that take majority of the load off of mainQueue?</p>