what is mean by synchronization?

Answer Posted / p.nanda kishore

Synchronization is a process of accessing a shared resource in a multithreaded environment by one thread at a time.

Generally in Multithreaded applications all the threads start execution at a time(i.e doing multiple task at a time) . In this situation we need a piece of code to used by one thread at a time then we need to use Synchronization.

When a thread access a Synchronized code it establishes lock with that code and all the other threads will be there in waiting state. The Lock will be released once the thread as finished it task and other thread waiting will acquire the lock.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by platform independence? What is an interface?

563


Why do we use return statement?

540


What is a parameter used for?

519


how its run?

570


What do you mean by ordered and sorted in collections in java?

550






What is bufferedwriter?

540


What are the different types of sorting in java?

539


Are global variables initialized to zero?

511


What do you understand by soft reference?

586


What is a package in java? List down various advantages of packages.

756


Can we override constructor?

538


What is data movement?

661


What does the “static” keyword mean?

584


Why is multithreading important?

493


Can you start a thread twice in Java?

633