• Post Reply 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

lock, monitor, mutex, or semaphore?

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i've heard these 4 words bandied about as if they were
all synonyms. can someone please tell me what the differences
between them are?
when i go
synchronized ( obj ) { /*...*/ }
what am i actually "getting"?
is it proper to say i'm getting
"the lock belonging to obj" or "a lock on obj"?
thanks!
 
John M. Gabriele
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, i think i'm starting to get the picture here.
...btw, i didn't mean to imply that folks around the
ranch were misusing terms; i guess i should've said
i'm just confused about these various terms i've heard. sorry.
anyhow, i *think* mutex's and semaphores are low-level os/jvm things
that i don't need to be concerned with at the java app level. the
generic term "lock" seems to cover however the jvm does it's synchronizing
magic.
as for "getting a lock on/of/for an object" or "locking an object",
they seem to all be equivalent to mean the same thing.
reply
    Bookmark Topic Watch Topic
  • New Topic