aspose file tools*
The moose likes Threads and Synchronization and the fly likes What are mutex threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "What are mutex threads" Watch "What are mutex threads" New topic
Author

What are mutex threads

ramya narayanan
Ranch Hand

Joined: Oct 06, 2008
Posts: 338
Dear all,
Do we have anything like mutex threads in java.
If yes what for it is used & can someone brief about it.
Regards.
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

This is a threading question and is probably better in the Threads forum. I'm sure a bartender will move it there for us.


Mutex is short for Mutual Exclusion. You can read more about them in the Mutual Exclusion wikipedia article. To the best of my knowledge, Java does not have Mutexes directly, but it does have Intrinsic Locks via the synchronized keyword, which act like Mutexes. Java also has Semaphores which are similar to Mutexes. The Semaphore Wikipedia article discusses the differences between a Mutex and a Sephamore.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36508
    
  16
Sorry I have been too busy to notice the suggestion I move the thread. Now it's off to the threads forum.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3950
    
  17

Java 1.5 has a concurrency APIs used for managing mutually exclusive locks and code execution. See the Concurrency Tutorial for more.


Steve
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What are mutex threads
 
Similar Threads
NX: Held Locks While Potentially Blocking on I/O
Sharing variables among classes?(easy question)
Why in java.lang.Object?
Thread states, notify, notifyAll, wait
max threads