Hi,
If we have
Here I would have thought that
Thread b would stop running as soon as the line a.join() was executed.
But it doesn't it continues to run.
Could anyone please explain to me how the join method is working in this example? Shouldn't the a.join() line have caused any executing threads to be halted and not run again until a completed?
I understand if I have 1 thread and start it in the main method that it puts the main method on hold until the thread on which I call join completes.
But what if we wanted 1 thread to run after another, as in the above code, where I want thread b to run only when thread a has completed?
Many Thanks