Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

question on Thread synchronization

Answer Posted / rajani nagandla

With respect to multithreading, 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 a particular 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 which
may otherwise lead to dirty reads and significant errors.
E.g. synchronizing a function:
public synchronized void Method1 () {
// method code.
}
E.g. synchronizing a block of code inside a function:
public Method2 (){
synchronized (this) {
// synchronized code here.
}
}

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we do exception handling in java and how many types of exceptions are there?

1112


How do you get the length of a string in java?

989


How do you decide when to use arraylist and linkedlist?

989


What is keyword and identifier?

1128


Is an integer an object?

955


Why is java logo a cup of coffee?

1163


What is the purpose of the enableevents() method?

1039


Explain the difference between abstract class and interface in java?

978


What is the purpose of abstract class?

1013


How to create a fecelet view?

982


Which keyword specify that a variable is effectively final ?

983


Can a source file contain more than one class declaration?

962


What is the difference between a local variable and an instance variable?

1100


What is udp in java?

966


Why call by value prevents parameter value change?

1071