Question :Whats the difference between notify() and notifyAll()? (CoreJava)
Answer :notify() is used to unblock one waiting thread; notifyAll() is used to
unblock all of them. Using notify() is preferable (for efficiency) when only
one blocked thread can benefit from the change (for example, when
freeing a buffer back into a pool). notifyAll() is necessary (for correctness)
if multiple threads should resume (for example, when releasing a "writer"
lock on a file might permit all "readers" to resume).
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Tuesday, March 10, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment