What are the different types of Synchronization?Is there any other way of method or class or object locking?

Showing Answers 1 - 4 of 4 Answers

ravi

  • Apr 24th, 2006
 

 Synchronization is using two ways

1) Method Synchronization

 example: Synchronized public void get(){}//sample example

2) block Synchronization

example: public void get{//this is calls method

         //here some boby of get();

    Synchronized(this){//this is calls Block

//here code inside the Synchromized block

}

//here some code of the get method

}//end of the get();

  Was this answer useful?  Yes

Deepthik

  • Apr 26th, 2006
 

          Type of Synchronizations :

1) Method level Synchronization :

            

  Was this answer useful?  Yes

Deepthik

  • Apr 26th, 2006
 

             Types of Synchronization:

1)Method level Synchronization: A method can be Synchronized by adding a perfix word "Synchronize". Here we have Parametrised Synchronization options also.

example: public Synchronize void foo(){}

2)Block level Synchronization: A block can be Synchronized by adding a perfix word "Synchronize". Here we have Parametrised Synchronization options also.

Synchronize {    }

  Was this answer useful?  Yes

Tafazzul hasan

  • Feb 21st, 2007
 


Types of Synchronization

  1> Method Level Synchronization

             a>   Method Synchronization
             b>   Static Method Synchronization

  2>Block Level Synchronization

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions