title: How to indefinitely pause a thread in Java and later resume it?
body: <p>Maybe this question has been asked many times before, but I never found a satisfying answer.</p>
  
  <p><H3>The problem:</H3><br>
  <BLOCKQUOTE><P>
  I have to simulate a process scheduler, using the round robin strategy. I'm using threads to simulate processes and multiprogramming; everything works fine with the JVM managing the threads. But the thing is that now I want to have control of all the threads so that I can run each thread alone by a certain quantum (or time), just like real OS processes schedulers.
  </P></BLOCKQUOTE></p>
  
  <p><H3>What I'm thinking to do:</H3>
  <BLOCKQUOTE>
  <P>
  I want have a list of all threads, as I iterate the list I want to execute each thread for their corresponding quantum, but as soon the time's up I want to pause that thread indefinitely until all threads in the list are executed and then when I reach the same thread again resume it and so on.
  </P>
  </BLOCKQUOTE></p>
  
  <p><H3>The question:</H3>
  <BLOCKQUOTE>
  <P>
  So is their a way, without using deprecated methods stop(), suspend(), or resume(), to have this control over threads?
  </P>
  </BLOCKQUOTE></p>