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

Complete the implementation of the class, The class TurtleQTwo extends Turt...

The class TurtleQTwo extends Turtle by adding one new method, plus, which is specified below. (All other features of TurtleQTwo are the same as for Turtle.) method plus(n in

Events calendar for existing website, Looking for: responsible, trustworthy...

Looking for: responsible, trustworthy, accountable, and knowledgeable CakePHP developer and web designer with great communication skills. I'm seeking great partnership and if th

How does java allocate heap and stack memory?, Each time an object is start...

Each time an object is started in Java it goes into the area of memory named as heap. The primitive variables like double and int are allocated in the stack, if they are local inst

Write a java program in a netbeans project, Write a Java program in a NetBe...

Write a Java program in a NetBeans project that reads a text file containing the names and addresses of several people and displays them all at once or one at a time upon selecting

Jumps in loops, explain jumps in loops and explain labelled loops

explain jumps in loops and explain labelled loops

State the verify phase of java program development, State the Verify phase ...

State the Verify phase of Java Program Development Before the bytecodes in an application are executed by the java interpreter, they are verified by the bytecode verifier in

Explain bios in java language, Explain BIOS in java language? BIOS bas...

Explain BIOS in java language? BIOS basically stand for Basic input/output system it is also called as the system BIOS or ROM BIOS is a de facto standard describing a firmware

Java, Ask question Write an inheritance hierarchy for classes Quadrilateral...

Ask question Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Create

Describe remote objects?, Describe Remote Objects A Remote Object is o...

Describe Remote Objects A Remote Object is one whose functions can be called from another JVM. A remote object class must execute the Remote interface. A RMI Server is an appl

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