About Question enthuware.ocpjp.v7.2.1239 :
Posted: Tue Aug 05, 2014 3:02 am
Good day!
Could you explain the following. English is my second language, so there could be misunderstanding.
I wonder about this sentence (10 - Threads, question Number 14):
"The concept is when a thread calls join() on another thread, the calling thread waits till the other thread dies."
Lets say we have main thread and one created in main, we call it t.
So it means: When thread call join() i.e. t calls join() - t.join() - on another thread i.e - main, the calling thread, which is t waits till the other thread i.e. - main thread dies.
But its actually other way around. When u say: t.join() inside main -> you saying: "Join me (the current thread-MAIN) to the end of t, so that t
must finish before I (the current thread-MAIN) can run again."
Please correct me if I am wrong, or just misunderstood.
Could you explain the following. English is my second language, so there could be misunderstanding.
I wonder about this sentence (10 - Threads, question Number 14):
"The concept is when a thread calls join() on another thread, the calling thread waits till the other thread dies."
Lets say we have main thread and one created in main, we call it t.
So it means: When thread call join() i.e. t calls join() - t.join() - on another thread i.e - main, the calling thread, which is t waits till the other thread i.e. - main thread dies.
But its actually other way around. When u say: t.join() inside main -> you saying: "Join me (the current thread-MAIN) to the end of t, so that t
must finish before I (the current thread-MAIN) can run again."
Please correct me if I am wrong, or just misunderstood.