What is the significance of the join and yeild methods in the threads?how and when are they used?
Help me!Help you!!!
posted 14 years ago
join() allows you to wait until one thread is done before another can continue. So, let's assume that Thread object test1 is the current thread of execution. If the following code is executed:
...The test1 will have to wait until test2 is dead before it can continue running. yeild(), theoretically, allows you to force the current thread of execution to take a break while a thread of equal importance is given a chance to run. I've heard that this isn't the most reliable method in the world, but others may disagree. [ May 06, 2003: Message edited by: Tom Purl ] [ May 06, 2003: Message edited by: Tom Purl ]