GeekInterview.com
Series: Subject: Topic:
Question: 2106 of 2110

What is synchronization and why is it important

With respect to multithreading, synchronization is the capability to control the access ofmultiple threads to shared resources. Without synchronization, it is possible for onethread to modify a shared object while another thread is in the process of using orupdating that object's value. This often leads to significant errors.
Asked by: Interview Candidate | Asked on: Aug 27th, 2005
Showing Answers 1 - 7 of 7 Answers
javid

Answered On : Jul 26th, 2005

Can u give me more information on syncronization and deadlocks and the practical usage of that.

  
Login to rate this answer.
RANJEET KUMAR RAVI

Answered On : Aug 27th, 2005

Threads share monitor(critical section) and only one thread can have monitor at a time.hence synchronization is important so that no other thread  attemp to hold the monitor.

  
Login to rate this answer.
ravikant

Answered On : Sep 14th, 2005

Well Synchronization is the way to make our program safe. It is used in multithreading. As we know when we have two or more threads that share a common code there can be some problem like inconsistent of data if one thread is updating data in that code. so if we make that sharable code(common code) synchronized then its  ensured that at a given time only one thread will be having rights to access that code. other threads can't  access the code untill its free that is not being used by other thread. hope your point is clear now.

Yes  1 User has rated as useful.
  
Login to rate this answer.
Anu Patreddy

Answered On : Sep 29th, 2005

Synchronization is a process of letting one thread to access the method while all other thread are waiting, which avoids deadlock.

  
Login to rate this answer.
Devidas Sonawane

Answered On : Nov 9th, 2005

Synchronization is the safe mechanism for memory leakage problem. In which we can modify one thread to complete another thread's process and then executes other. 

  
Login to rate this answer.
priya

Answered On : Sep 13th, 2007

Synchronisation is a phenomenon in multithreaded programming which enforce synchronicity when we need it. For eg, if we want two threads to share a complicated datastructure we need to ensure that they dont conflict with each other. That is we must prevent one thread from writing data while the other is in the middle of reading it. For this process, Java uses the concept of monitor. The monitor is a control mechanism and it is like a small box that can hold only one thread. Once a thread enters the monitor, all other threads must wait until it remains in that box (monitor). In Java each object has its own implicit monitor that is entered when the object's synchronised method is called. Once a thread is inside a synchronised method, no other thread can call any other synchronised method on the same object.

Yes  1 User has rated as useful.
  
Login to rate this answer.
bijuleo

Answered On : Nov 8th, 2007

View all answers by bijuleo

Synchronization is the mechanism that ensures that only one thread is accessed the resources at a time. In a practical point of view assume that two threads are trying to update bank balance at the same time!!! How we can solve this issue the answer is sychronization. Hope you got the importance

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.