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...

How the threads are synchronized?

Answer Posted / seshadri pera

Threads are synchronized in two ways.

1) block level
2) Method level

Block level synhronization is the better performance
compare to method level.

Block Level:
see the code syntax for block level
synchronized {..
....//code to lock the specific object here..
...}

Method Level:
See the syntax
public void synchronized XXXMethodName(Parameters or
object to acquire locking){.....
...}

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is treeset and treemap in java?

1137


What is meant by method?

1177


What is the vector class in java programming?

1137


What does substring mean?

1027


What is final keyword?

1235


What is object cloning in Java?

1146


What is the driver class?

1089


What is the independent variable in an experiment?

999


Why call by value prevents parameter value change?

1123


How many JVMs can run on a single machine and what is the meaning of Just-In-Time (JIT) compiler?

1544


How does class forname work in java?

1022


What is mean by exception?

1076


What about instanceof operator in java?

1065


Which class is used by server applications to obtain a port and listen for client requests?

1016


What will be the output of round(3.7) and ceil(3.7)?

1166