Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Lock on Objects  RSS feed

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Report post to moderator
Why does each Object in Java has a corresponding lock?
What is the utility of having such a functionality.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Report post to moderator
Well..locks are used to obtain lock on any object.As simple as that...

seee when multiple threads are working on a single object and you want to synchronize then each thread should obtain lock on object before operating...
it is same as monitor concept in operating systems...
 
Rancher
Posts: 42973
76
  • Mark post as helpful
  • send pies
  • Report post to moderator
Seth,

please don't post the same question multiple times. If you need to edit a post, click the little paper-and-pencil icon ().

Let's continue the discussion in this duplicate post.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!