Results 1 to 6 of 6

Thread: What does Mutex mean in Java?

  1. #1
    Join Date
    Dec 2009
    Posts
    68

    What does Mutex mean in Java?

    Hello friends,

    I am beginner in the field of Java programming. The java programming sounds quit difficult to understand as compare to C++ programming. I want to be aware about the "Mutex". I don't know what does it mean in Java programming. According to my knowledge "Mutex" concept is not available in C++ programming. If you have knowledge about the "Mutex" from the java programming, then please share with me.

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: What does Mutex mean in Java?

    A Mutex is nothing but simple non-re entrant mutual exclusion lock. The lock is free upon construction. Each acquire gets the lock, and each release frees it. Releasing a lock that is already free has no effect. MUTEX is achieved in java by the keyword "synchronized" used when two or more methods try to access the same variables/Data structure. Mutex can be useful in constructions that cannot be expressed using java synchronized blocks because the acquire/release pairs do not occur in the same method or code block.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: What does Mutex mean in Java?

    Mutex in Java programming is very useful in constructions which can't be expressed using java synchronized blocks because the acquire/release pairs do not occur in the same method or code block. Mutex in Java allows extremely fine-grained locking and so increases potential concurrency, at the cost of additional complexity and overhead that would normally make this worthwhile only in cases of extreme contention. This allows extremely fine-grained locking, and so increases potential concurrency, at the cost of additional complexity and overhead that would normally make this worthwhile only in cases of extreme contention.

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    Re: What does Mutex mean in Java?

    Hi,

    Mutex is basically mutual exclusion in which single thread can acquire the resource at once. When single thread of program try to acquires the resource, no other thread is allowed to acquire the resource until the thread owning the resource releases. This implementation of Mutex in java makes no attempt to provide any fairness or ordering guarantees. If you need them, consider using one of the Semaphore implementations as a locking mechanism.

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    Re: What does Mutex mean in Java?

    Action performed by a thread owning a mutex is the updating of global variables. Mutex can be useful in constructions that cannot be expressed using java synchronized blocks. This is a safe way to ensure that when several threads update the same variable, the final value is the same as what it would be if only one thread performed the update. A mutex variable acts like a "lock" protecting access to a shared data resource. The basic concept of a mutex as used in threads is that only one thread can lock a mutex variable at any given time.

  6. #6
    Join Date
    May 2008
    Posts
    2,012

    Re: What does Mutex mean in Java?

    Mutex in java programming can used for to hand-over-hand locking across the nodes of a linked list.To use Mutex concept in Java you need to follows several steps. For that you first need to create and initialize a mutex variable. Then define multiple threads for to attempt lock over mutex. Then you should implement some set of actions for thread to perform. Then you need to unlocks the mutex, and finally destroy the mutex.

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. Unlocking the concept of Mutex
    By WarlordD in forum Software Development
    Replies: 5
    Last Post: 27-05-2011, 02:31 AM
  3. Pthread and mutex with an unlock support
    By Habiba22 in forum Software Development
    Replies: 5
    Last Post: 26-05-2011, 06:13 AM
  4. Critical Error: Attempt to release mutex not owned by caller
    By Iksura in forum Small Business Server
    Replies: 4
    Last Post: 06-03-2009, 03:22 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,180,508.71379 seconds with 16 queries