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

How is treeset implemented in java?

1027


What does pointer mean?

1056


What is the use of flag?

1092


Why does java not allow multiple public classes in a java file ?

4535


Explain reverse a linked list iterative solution in java?

925


What is java reflection?

983


What are the advantages of encapsulation in java?

1012


Explain the difference between extends thread vs implements runnable in java?

1128


What is the difference between instanceof and isinstance?

1061


What is the symbol for space?

1000


we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

2032


Why we used vector class?

1069


What is the meaning of I ++ in java?

1184


What is private public protected in java?

1033


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2820