What synchronization constructs does Java provide? How do they work?

Showing Answers 1 - 4 of 4 Answers

Vasudha

  • Mar 23rd, 2005
 

You may synchronize a class, a method or a portion of a method. Synchronization will make the code thread safe.

  Was this answer useful?  Yes

Synchronization can be used by:

using synchronized function() to lock the object
using static synchronized function() to lock the class object
using wait(), notify() and notifyall() for two objects to communicate
using the method of reentrant locks using the trylock() mechanism to lock the objects an the condition variables are used to communicate.

  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