Sven Sylta wrote:So does that mean that the t2.join()-method is not invoked until the first thread has died?
Yes, that is what it means.
Sven Sylta wrote:Are the threads running simultaneously or not? What exactly is happening here? Thanks for your time.
Yes, threads are running simultaneously. What happens in your code: Two new threads are created and started, and then the main thread first waits for the first one to finish (line 13), and then for the second one to finish (line 14).
join() will return immediately if the thread on which it is called has already finished. So, suppose that the main thread is waiting for t1 to finish in line 13 and in the mean time t2 finishes, then when the main thread reaches line 14 to wait for the second thread, line 14 will immediately return.