CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JAVA DETAILS
Question :
What is synchronization and why is it important?
Category Java Interview Questions
Rating (3.4) By 56 users
Added on 10/13/2004
Views 4572
Rate it!
Answers:

With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one
thread to modify a shared object while another thread is in the process of using or updating that object's value. This often causes dirty data and leads to significant errors.



Synchronization occurs when you want two threads to run, but they are somewhat dependent on each other.

A thread is a distinct flow of program logic that can be executed at the same time as other threads. This make it seem like two things are running simultaneously (kind of like how word spell checks as you type).

Occasionally you might need one thread to wait until another thread gets to the same point.

An example might be if you had a program, and a fancy user interface that required animation. You might pause the logic part of your program and wait until the animation finished before the threads continue on. This is synchronization.



Posted by: akanksha    

Contact akanksha Contact akanksha

If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    What are synchronized methods and synchronized statements?
    View Answer
    What is the serialization?
    View Answer
    How to make a class or a bean serializable?
    View Answer
    How many methods in the Serializable interface?
    View Answer
    How many methods in the Externalizable interface?
    View Answer
    What is the difference between Serializalble and Externalizable interface?
    View Answer
    What is a transient variable?
    View Answer
    Connecting to a Database and Strings Handling?
    View Answer
    Searching a String?
    View Answer
    Replacing Characters in a String?
    View Answer

    Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

    Notify me when better answer is posted!
    Email:

    View ALL Java Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions
    Page URL: http://www.coolinterview.com/interview/351/default.asp?cachecommand=bypass


    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

    0.83
    Cache = 0.046875 Seconds