INTERVIEW QUESTIONS
J2EE
JAVA
DETAILS
Question: What is synchronization and why is it important?
Answer: 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.
|
Question:
What is synchronization and why is it important?
Answer:
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. Source: CoolInterview.com
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. Source: CoolInterview.com
Answered by: akanksha | Date:
| 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.
|