November 2006
Intermediate to advanced
224 pages
3h 29m
English
Thread t = new Thread(MyThread); t.start(); // do some other processing t.join(); // continues after thread t completes |
It might be the case that you want one thread of execution to wait for another thread to complete before continuing with the current thread. Joining threads is a common method of causing one thread to wait for the completion of another thread. For example, in this phrase, we start thread t from within the thread that is executing these lines of code. We then, in most cases, do some additional processing and call the join() method on the thread object when we want to stop execution of this thread and wait for the thread t to complete. Once thread t completes, execution will continue to the statements ...
Read now
Unlock full access