title: Semaphores and shared memory in linux
body: <p>I have a bit of a problem at how to synchronize 2 processes. First process must create a shared memory, then wait for the second process to fill the shared memory and signalize it back to the first process. I don't know how to make the first process wait. </p>
  
  <p>Here is a pseudocode of how my processes look like:</p>
  
  <p>Process1:</p>
  
  <pre><code>create shared memory
  create a semaphore
  wait for the second process /* this part i dont know how to write */
  output the shared memory
  </code></pre>
  
  <p>Process2:</p>
  
  <pre><code>get shared memory id
  get the semaphore id
  wait();
  fill the shared memory 
  signalize();
  </code></pre>