difference between yield and join method in multithreading

please explain the difference between yield and join method in multithreading
LVL 9
Manikandan ThiagarajanSenior consultantAsked:
Who is Participating?
 
girionisConnect With a Mentor Commented:
Yield: the current thread stops executing and gives a chance to other (waiting) threads to execute. If the other waiting threads have a lower priority then the current thread keeps on executing.
Join: the current thread calls join on another thread (lets say t1). t1 starts executing and the current thread goes into a waiting state. When t1 finishes the current thread resumes execution.

For more info:

http://www.java-forums.org/new-java/12990-difference-between-thread-yield-thread-sleep-methods.html
http://docs.oracle.com/javase/6/docs/api/index.html?java/util/Calendar.html
0
 
anilallewarCommented:
@Vee_Mod, this post was in answer to providing explaination on the behaviour which is not available in forum.

It is not a solution but an explaination. For the other questions where solution was required, I have provided links to reference material.
0
 
Manikandan ThiagarajanSenior consultantAuthor Commented:
Good Answer from girionis now i understand the concepts
0
All Courses

From novice to tech pro — start learning today.