• Post Reply Bookmark Topic Watch Topic
  • New Topic

lock, monitor, mutex, or semaphore?

 
John M. Gabriele
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!