difference between yield and join,wait and notify

could you please explain difference between yield and join,wait and notify in multithreading
LVL 9
Manikandan ThiagarajanSenior consultantAsked:
Who is Participating?
 
Michael-BestCommented:
(java-multithreading)

Yield simply temporarly stops to allow other threads to continue.
Join is used to join two threads together that are performing tasks at the same time.
A call to wait from within synchronized code causes the thread to give up its lock and go to sleep. This normally happens to allow another thread to obtain the lock and continue some processing. The wait method is meaningless without the use of notify or notifyAll which allows code that is waiting to be notified that it can wake up and continue executing.

Also see:
http://www.jchq.net/certkey/index.htm
0
 
Manikandan ThiagarajanSenior consultantAuthor Commented:
I am preparing for an interview i need to brush up my skills
0
 
basav_comCommented:
0
 
Manikandan ThiagarajanSenior consultantAuthor Commented:
difference beween notify and noifyall
0
 
Michael-BestCommented:
The difference between notify and notifyAll
Simply put, it depends on why your threads are waiting to be notified. Do you want to tell one of the waiting threads that something happened, or do you want to tell all of them at the same time
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.