title: wait and notify multithreading in c++
body: <p>I have a question about wait and notify multithreading in c++.</p>
  
  <p>I have a container that <code>deque&lt;stack&lt;string&gt;&gt; lines</code>, which is like below.</p>
  
  <h2>deque(waiting line for cashier)</h2>
  
  <p>front(deque)</p>
  
  <blockquote>
    <p>cart1
     - item1 - item2 - item3</p>
  </blockquote>
  
  <hr>
  
  <p>index 2(deque)</p>
  
  <blockquote>
    <p>cart2 - item1
          - item2</p>
  </blockquote>
  
  <hr>
  
  <p>index 3(deque)</p>
  
  <blockquote>
    <p>cart3 -item1
        -item2 - item3</p>
  </blockquote>
  
  <p>I have 5 cashier lanes (threads)
  And I want to allocate carts to each lanes and process calculation.
  I asked it to my teacher and he said I should use "wait and notify".
  I still don't understand threading clearly and I don't know how to implement shared resources threading..</p>