What is synchronization? Why is it used? What are its disadvantages?

This question is related to Oracle Interview

Showing Answers 1 - 12 of 12 Answers

rajesh_ch

  • May 5th, 2010
 

It is mechanism that ensures only one thread at a time can access a block of code, which we might cause data courruption if it accessesd by more threads ata time.

Uses: Eleminates data corruption.

Disadvantage: Execution time will be more due to single thread implementation.

  Was this answer useful?  Yes

sajid

  • Oct 8th, 2015
 

Synchronization we can call only one thread between multiple threads. Ex: ATM transaction

  Was this answer useful?  Yes

Shailesh Shinde

  • May 25th, 2017
 

Synchronization makes sure that shared resources or data can be accessed by only one thread at a time while execution. its advantage is that it prevent data inconsistency and disadvantage is that it makes execution slower as it makes other thread wait till current thread completes execution.

  Was this answer useful?  Yes

Manoj

  • Apr 10th, 2018
 

Synchronisation is a mechanism to make sure that exactly one thread will execute block with fresh values from main memory i.e. it must execute two way memory barrier. When thread enter into sync block then it must invalidate all values from cache and read from Main memory and vica versa

  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