Question:
What do you understand by Synchronization?
Answer:
Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can access one resource at a time. In non synchronized multithreaded application, it is possible for one thread to modify a shared object while another thread is in the process of using or updating the object's value. Synchronization prevents such type of data corruption. Source: CoolInterview.com
Synchronization is helpful only when you know that more than 1 thread is trying to access the same method. for that purpose, you wuill have to synchronize the method ie. only that thread which has the key for the lock(the synchronization lock) will be let inside. No other thread can access that method untill it is given the key Source: CoolInterview.com
Answered by: Naveen | Date: 9/10/2009
| Contact Naveen
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.
|