title: Rendezvous ADA - how it works
body: <p>I'm trying to understand how the R-V in ADA works:</p>
  
  <p><strong>server (pseudo)code:</strong> </p>
  
  <pre><code>task test is
    entry put (num: in integer);
    entry get (num: out integer);
  end test;
  
  task body test is
    local_num: integer;
  begin
    accept put (num: in integer) do
      local_num := num;
    end put;
  
    // some next processing of local_num, eg:
    local_num := local_num * 2;
  
    accept get (num: out integer) do
      num := local_num;
    end get;
  end test;
  </code></pre>
  
  <p>and the client a server are communicating as following:</p>
  
  <pre><code>client (a)    | server (b)
  ================================
                |   // sleep
  (call_entry)  |   // sleep
  a.put(num)    |   // sleep
    // sleep    | (accept_entry)
    // sleep    | b.accept put(num)
    // sleep    | local_num := num;
    // sleep    | local_num := local_num * 2;
                |   ???   &lt;--------------------- what is happening after that point?
  (call_entry)  |   // sleep
  a.get(num)    |   // sleep
    // sleep    | (accept_entry)
    // sleep    | b.accept get(num)
  </code></pre>
  
  <ul>
  <li>Is it correct? </li>
  <li>Can you describe me how it continues?</li>
  <li>Who awakes the client to get the result? How the client know, that it can get the result?</li>
  </ul>
  
  <p><strong>update:</strong> (correct process?)</p>
  
  <pre><code>client        | server (test)
  ================================
  test.put(num) |   // sleep      ----------&gt; call entry
  test.get(A)   | accept put(num) ----------&gt; accept entry PUT (call entry GET to the QUEUE)
    // sleep    | local_num := num;
    // sleep    | local_num := local_num * 2;
  test.get(A)   | accept get(A)   ----------&gt; accept entry (removed from the QUEUE)
                |   // sleep
  </code></pre>