• 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

What is a mutex?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seen the term here but nowhere else yet.
 
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mutual Exclusion. See google for more info.
 
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mutex is a Computer Science term for what Java 2 calls a lock. Since only one thread can hold the lock on an object at one time, a section of code synchronized on an object cannot be entered by a thread while another thread holds the lock on that object. The mechanism for enforcing this rule is called a mutex.
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Definitely look up mutex on Google to get a deeper answer, but one example of a mutex is Java's built-in object locking via synchronization. Mutually exclusive when X "has access", Y and Z cannot "gain access." In Java, when a block of code synchronizes on an object, it obtains a mutually exclusive lock on that object. Any other block of code in another thread cannot obtain a lock on the same object until the first block releases the lock.
 
Dave Alkire
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kashif Riaz:
Mutual Exclusion. See google for more info.


Perfect; thanks everyone for the replies! Usually I google for terms instead of posting, but in this case I just wanted to know what y'all, specifically, would say..
Ya see I'm re-reading a section in Sierra's _Sun Certified programmer & Developer for Java 2_, Chapter 9, "Threads", re-doing Exercise 9-2, "Synchronizing a Block of Code".. There was a bit I didn't grok, so I was searching through these JavaRanch forums and kept finding undefined references to that term. But anyway thanks again; all better now.
reply
    Bookmark Topic Watch Topic
  • New Topic