Solved

difference between yield and join method in multithreading

Posted on 2012-04-09
5
359 Views
Last Modified: 2012-04-20
please explain the difference between yield and join method in multithreading
0
Comment
Question by:stmani2005
5 Comments
 
LVL 11

Expert Comment

by:anilallewar
ID: 37827875
@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
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
ID: 37836696
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
 
LVL 8

Author Comment

by:stmani2005
ID: 37874842
Good Answer from girionis now i understand the concepts
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now