title: dispatch_async() in c
body: <p>I am having problems understanding GCD. i  need to use dispatch_async to spawn the function put_values() which will in an endless loop put values into a buffer. Get_values() will remove then also in an endless loop. I therefore have to run them at the same time without order to see if i implemented my semaphores for waiting correctly. WIll the code below do that (running them asynchronously
  ) ? 
  Thank you !</p>
  
  <pre><code>dispatch_queue_t producer = dispatch_queue_create("producer", NULL);
  dispatch_queue_t consumer = dispatch_queue_create("consumer", NULL);
  
  dispatch_async(producer, 
                 ^{
                     put_values();
                 });
  
  dispatch_async(consumer, 
                 ^{
                     get_values();
                 });
  
  dispatch_main();
  </code></pre>