Hello,
this is my first post/question, so please bear with me - and apologies in advance for the length of the post.
I'm trying to understand the behavior of join() using the following code.
What I expected was that when the main
thread executes the try block and calls the method join() on T1, it (the main thread) stops and waits for T1 to finish executing before becoming runnable again. However, the following result suggests that this is not the case, since the main thread is running again after the counter of thread T1 is at 83, and continues counting down from 188!
Can anybody please explain why thread T1 is not counting down to 1, but stops at 83? Shouldn't the main thread wait until thread T1 completes?
Thanks and best wishes,
Udo