Jeff Verdegan wrote:There's no way to force multiple threads to run in parallel. By putting tasks in separate threads, you're only saying that your program logic allows them to run simultaneously. It's up to the JVM and OS to decide whether to run one after the other, have them take turns, or run them simultaneously on separate cores.
Hmmm, partially true i believe.
Case 1: if i am looking at those two threads from JVM perspective, each thread is not waiting for other thread to complete. That said they are running in parallel.
Case 2: if i am looking at those two threads from OS level, either each thread gets its opportunity in a time sliced manner or actually run parallel depending on the processing power the machine possess.
FWIW, OP question belongs to Case 1.