GeekInterview.com
Home
Tech Articles
Code Samples
Learn
Freelance Projects
Online Testing
Geek Talk
Job Postings
Knowledge Base
Geek Blogs
Question Bank
Interview Questions
Certification
Placement Papers
Tech FAQ
Career Advice
Engineering
Ask Question
I am new,
Sign me up!
User Name
Remember Me?
Password
Interview Questions
Certification
Placement Papers
Tech FAQ
Career Advice
Engineering
Ask Question
GeekInterview.com
>
Interview Questions
>
J2EE
>
Core Java
Go To First
|
Previous Question
|
Next Question
Core Java
| Question 496 of 502
Print
Inter Thread Communication
What are all the methods used for Inter Thread communication and what is the class in which these methods are defined?
Total Answers and Comments:
5
Last Update: August 25, 2009 Asked by:
renijoym
Sponsored Links
Best Rated Answer
—
Submitted by
:
sreedhar dantam
Inter thread communication is done using wait and notify (or notify all). These methods are defined in 'Object' class.
Above answer was rated as good by the following members:
uday bhasker reddy
,
Dilip Lodha
,
salil_sp
,
sushilkotnala
,
ahamza59
,
ashish_dhole30
,
subbu204655
,
minakshi sharma
,
jasjasan
,
sandeep549
December 15, 2008 00:17:21
#1
maneesh.ce.2007
Member Since: November 2008 Contribution: 12
RE: Inter Thread Communication
There are three ways in which Threads communicate with each other :
wait: It tells the calling thread to give up the monitor until some other thread enters the same monitor an calls Notify or Notifyall...
notify: It wakes up the first thread that called Wait() on the same object...
NotifyAll: It allows all the threads that called Wait() on the same object.The thread having the highest priority will run first...
Is this answer useful?
Yes
|
No
5
0
Overall Rating:
+5
December 19, 2008 09:28:28
#2
bitwizard
Member Since: December 2008 Contribution: 1
RE: Inter Thread Communication
Thread
Thread.join() Thread.wait() Thread.interrupt() Thread.stop()
Is this answer useful?
Yes
|
No
0
3
Overall Rating:
-3
December 19, 2008 14:23:54
#3
sreedhar dantam
Member Since: December 2008 Contribution: 2
RE: Inter Thread Communication
Inter thread communication is done using wait and notify (or notify all). These methods are defined in 'Object' class.
Is this answer useful?
Yes
|
No
4
0
Overall Rating:
+4
May 12, 2009 02:35:16
#4
Radhakrishna P
Member Since: May 2009 Contribution: 2
RE: Inter Thread Communication
When Threads are executing on shared resources inorder to establish the communication among them the Object class providing some native methods like wait() notify() notifyAll().
Is this answer useful?
Yes
|
No
3
0
Overall Rating:
+3
August 25, 2009 08:34:55
#5
satyanandr
Member Since: August 2009 Contribution: 2
RE: Inter Thread Communication
Two or more threads are communication via wait() notify() and notifyAll() method of an Object class.
wait(): method will lock the monitor of the thread to not process.
notify(): method will wake the
thead
which undergoes waiting state the wait state is waiting to called by notify or notifyAll()
notifyAll(): method will wake the
theads
which undergoes waiting state.
Is this answer useful?
Yes
|
No
Go To Top
Sponsored Links
Related Categories
—
Core Java Interview Questions
EJB Interview Questions
Hibernate Interview Questions
Java Interview Questions
Java Patterns Interview Questions
JDBC Interview Questions
JMS Interview Questions
JSP Interview Questions
Java OOPS Interview Questions
Ruby Interview Questions
Servlets Interview Questions
Spring Interview Questions
Struts Interview Questions
Websphere Interview Questions
Sponsored Links
About Us
-
Privacy Policy
-
Terms and Conditions
-
Contact
-
Ask Question
-
Propose Category
-
Site Updates
Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved