Advantages of Object Synchronization over Resource Synchronization in Java

Mr. Chetan Singh Khinchi, Mr. Vaibhav Sharma, Mr. Ronak Jain

Abstract


In java synchronization is basically of two types – First is , Method(Resource) synchronization and Second one is Block(Object) synchronization . Both of them adds to the security of code while multiple threads are in action and have very minute differences over one another. People often get confused with both of the ways and do not understand the usage and applicability of this ways by themselves[1]. Here I suggest that rather than using Method(Resource) synchronization for security of code in multithreading in java one must give preference to the Block(Object) synchronization .This paper is an Analytical as well as a Suggestive paper which actually describes both the ways with all minute differences covered with a proper analysis of usage and applicability, and then suggests that why one must use Block(Object) synchronization over Method(Resource) synchronization in java while multiple threads are in action.

Keywords: Synchronization , block , resource , object , method , Monitor , thread, sleep , join


Full Text:

PDF


DOI: https://doi.org/10.26483/ijarcs.v5i5.2197

Refbacks

  • There are currently no refbacks.




Copyright (c) 2016 International Journal of Advanced Research in Computer Science