title: Process synchronization
body: <h3>Factors designating a piece of code as critical section</h3>
  <p>As of I understand, <code>process synchronization</code> is employed using kernel data structures such as <code>semaphores</code>, to  prevent concurrent access to the <code>critical section</code> of the code. <strong>In general I see definitions to be, &quot;critical section  is the piece of code that may access shared data (or) shared resources&quot;. So the questions are:</strong></p>
  <ul>
  <li>Shared data is a user space entity. Hence it is the responsibility of the user process to ensure consistency of its access.</li>
  <li>I presume that concurrent access to resources by multiple processes is something that the kernel should take care. What sort of user level synchronisations are required there?</li>
  <li>What are the factors by which a piece of code in user space program is decided to be a critical section.</li>
  </ul>