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

I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

1043


What is getclass () getname () in java?

1091


What is heterogeneous in java?

899


How do you clear a list in java?

1038


What is unmodifiable list in java?

900


What state does a thread enter when it terminates its processing in java programming?

976


What is java dot?

882


how its run?

1001


What are the differences between checked exception and unchecked exception?

918


Can this keyword be used to refer static members?

971


What is internal iteration in java se 8?

1124


What is the purpose of javac exe?

1023


What are the five major types of reference sources?

1036


Explain about join() method?

901


What is nextint java?

972