title: Centralized algorithm for mutual exclusion - queue usage
body: <p>Quoting from <a href="https://books.google.co.il/books/about/Distributed_Systems.html?id=UKDjLQAACAAJ&amp;hl=en" rel="nofollow">DISTRIBUTED SYSTEMS - Principles &amp; Paradigms</a> section 6.3.2  </p>
  
  <blockquote>
    <p>The coordinator takes the first item off the queue of deferred
    requests and sends that process a grant message</p>
  </blockquote>
  
  <p>So essentially, the coordinator process (or thread if we work on the same tier) is using a <strong><em>queue</em></strong> in order to buffer the requests, but the queue itself is a <strong><em>shared resource</em></strong> which needs mutual exclusion protection, so it seems like as the chicken &amp; the egg syndrome...</p>
  
  <p>My questions is how to implement the centralized algorithm, say on the very same machine, using only memory RD/RW primitives (i.e. no CAS, no mutexes etc.) C like code would be great.</p>
  
  <p>The incentive for this question is simply widening my distributed system horizons. </p>