What does the keyword "synchronize" mean in java, JAVA Programming

Assignment Help:

What does the keyword "synchronize" mean in java. What are the usage and disadvantages of synchronization?


Related Discussions:- What does the keyword "synchronize" mean in java

Describe graphics objects, Describe Graphics Objects ? In Java all draw...

Describe Graphics Objects ? In Java all drawing takes place via a Graphics object. This is an example of the class java.awt.Graphics. Initially the Graphics object you use w

Describe the java.lang package, Describe the java.lang package ? Each p...

Describe the java.lang package ? Each package describes a number of classes, exceptions, interfaces, and errors. For instance, in Java 1.1 the java.lang package holds these:

Develop billing software, Develop Billing Software Project Description: ...

Develop Billing Software Project Description: Need software to print bills on A4 paper in the format provided. The details are shown below - 1. Serially generated Invoice

Create a new project in eclipse , Task 1 Create a new project in Eclips...

Task 1 Create a new project in Eclipse called Assignment 1. Within this project create a package called task01. 1/ Download the class Date (you must use this class - no

Creating a system to keep track of computer science books, You are part of ...

You are part of a team creating a system to keep track of computer science books that a publisher is producing. Create a UML class diagram for a "computer science book". You must h

How to get data from the velocity page in a action class, We can get the va...

We can get the values in the action classes by using data.getParameter("variable name described in the velocity page");

What is a packet in the network environment, What is a packet within the ne...

What is a packet within the network environment? What kind of information does it contain? A packet is the shortest unit of data transmitted over a computer network. It's a mes

Explain the importance of abstract classes in java, Question: (a) Expl...

Question: (a) Explain the importance of abstract classes in Java with an appropriate example. (b) Explain what is meant by an interface in Java? Use a simple example to il

Application for android studio, 1- I need application used android studio w...

1- I need application used android studio with source code and all file . same this application : 2-">https://play.google.com/store/apps/details?id=com.magnetic.openmaps&hl=en 2

12/3/2013 1:49:04 AM

Synchronize is used when you want to create your methods thread protected. The disadvantage of synchronise is it would end up in slow down the program. And if it will not be handled properly it can end up in dead lock.

1. Only use synchronization when writing multithreaded code as there is a speed cost associated with its use.

2. In case of synchronized method modifier, the byte code generated is similar as non-synchronized method. The only difference is that a flag called ACC_SYNCRONIZED property flag in method''s method_info structure is set if the synchronized method modifier is present.

3. Also, synchronized keyword can create the code larger in size if used in the body of the method as byte code for monitor enter or monitor exit is generated in addition to any exception handling.

 

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd