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.

Showing Answers 1 - 9 of 9 Answers

javid

  • Jul 26th, 2005
 

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

  Was this answer useful?  Yes

RANJEET KUMAR RAVI

  • 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.

  Was this answer useful?  Yes

ravikant

  • 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.

Anu Patreddy

  • Sep 29th, 2005
 

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

  Was this answer useful?  Yes

Devidas Sonawane

  • 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. 

  Was this answer useful?  Yes

priya

  • 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.

bijuleo

  • Nov 8th, 2007
 

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

  Was this answer useful?  Yes

Give your answer:

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

 

Related Answered Questions

 

Related Open Questions