title: Reading or getting a command from console thread
body: <p>I have a program in c++ with several threads in it. I want one of the threads to be able to read/get commands from the console while others continue running, for example: "play", "stop", "pause",...</p>
  
  <p>something like:</p>
  
  <pre><code>while (1)
  {
  
      std::string str;
      getline(std::cin, str);
  
      /* do something */
  
  }
  </code></pre>
  
  <p>Will it work? Any suggestions?</p>
  
  <p>Thanks in advance.</p>