Like Tree3Likes
  • 1 Post By Yarin
  • 1 Post By anduril462
  • 1 Post By Yarin

Explain Mutual Exclusion ?

This is a discussion on Explain Mutual Exclusion ? within the Tech Board forums, part of the Community Boards category; Hello everybody. We will be having a reporting tomorrow in our Programming Languages subject. I am assigned to discuss about ...

  1. #1
    Registered User
    Join Date
    Dec 2013
    Location
    Cebu City, Philippines
    Posts
    14

    Explain Mutual Exclusion ?

    Hello everybody.
    We will be having a reporting tomorrow in our Programming Languages subject. I am assigned to discuss about Mutual Exclusion in shared data and task but I am having a hard time getting an explanation on this topic and examples to present to the class. I have been actually reading articles and references about the topic and understood its concept but when I look at some algo, I don't get how it works anymore.

    Can anybody help me? Thanks.

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    2,414
    mutual exclusion is used to ensure that two concurrent processes do not simultaneously access shared data. it is generally achieved by the use of a "mutex" object. mutex is an abbreviation for mutual exclusion. the concurrent processes attempt to "lock" the mutex, and only one may hold a lock at one time. only the process holding the lock may access the shared data. once the process is finished accessing the shared data, it unlocks the mutex, allowing the next process to lock it.
    Code:
    namespace life
    {
        const bool change = true;
    }

  3. #3
    Registered User
    Join Date
    Feb 2014
    Posts
    13
    1) Mutual Exclusion is simple called as mutex, it is one of OS object.
    2) In multi tasking environment, it allows only one task to access the shared data.
    3) Every task has to put mutex lock when accessing shared data and release it (mutex unlock) once it is completed.

  4. #4
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,627
    Mutual Exclusion is actually very simple!
    Lets say a group people want some ice cream. They all have their bowls, but the ice cream scooper can only be used by one person at a time, the rest have to wait. In this case, the scooper is the shared data, and it's use is mutually exclusive.
    Elkvis likes this.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  5. #5
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,496
    Quote Originally Posted by Yarin View Post
    Mutual Exclusion is actually very simple!
    Lets say a group people want some ice cream. They all have their bowls, but the ice cream scooper can only be used by one person at a time, the rest have to wait. In this case, the scooper is the shared data, and it's use is mutually exclusive.
    You can keep the scooper. I'm taking the whole carton, and I ain't giving it back! Sharing ice cream is for suckers.

    I guess that's just plain "exclusion", nothing mutual about it. It's an older mechanism for resource handling, not implemented in most modern systems.
    Elkvis likes this.

  6. #6
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,627
    Quote Originally Posted by anduril462 View Post
    You can keep the scooper. I'm taking the whole carton, and I ain't giving it back! Sharing ice cream is for suckers.
    I guess that's just plain "exclusion", nothing mutual about it. [snip]
    That kind resource handling sounds an awfully lot like the kind used in this one operating system I know of by Microsoft.
    anduril462 likes this.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    2,414
    Quote Originally Posted by Yarin View Post
    Mutual Exclusion is actually very simple!
    Lets say a group people want some ice cream. They all have their bowls, but the ice cream scooper can only be used by one person at a time, the rest have to wait. In this case, the scooper is the shared data, and it's use is mutually exclusive.
    this is probably the best possible explanation of mutual exclusion.
    Code:
    namespace life
    {
        const bool change = true;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can't get Mutual Exclusion to Work
    By joatmon in forum C Programming
    Replies: 3
    Last Post: 11-05-2013, 07:31 AM
  2. Mutual Exclusion
    By jeffc1 in forum C++ Programming
    Replies: 3
    Last Post: 10-09-2010, 05:52 PM
  3. Producer/Consumer W/ mutual exclusion
    By pantherman34 in forum C Programming
    Replies: 10
    Last Post: 05-04-2010, 11:03 AM
  4. Mutual exclusion with threads
    By axr0284 in forum C++ Programming
    Replies: 10
    Last Post: 12-21-2005, 07:31 AM
  5. Mutual Exclusion Locks
    By sglass in forum C Programming
    Replies: 3
    Last Post: 03-21-2002, 12:31 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21