CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2008
    Posts
    116

    How To Implement Mutex In Windows

    Hi all,

    In windows API we have 3 functions to control mutex:
    CreateMutex,OpenMutex, and ReleaseMutex.

    Currently, I want to implement it by myself so I have google it but I found nothing.

    What should I do to solve this problem ?

    Thanks.
    My English is very bad. So tell me if Something I talked make u confuse.
    My Ebook Store: www.coding.vn/book.php

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: How To Implement Mutex In Windows

    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2008
    Posts
    116

    Re: How To Implement Mutex In Windows

    Hey, thank for your quickreply. But you have missunderstood me.

    I just want to implement 3 above functions like CreateMutex,OpenMutex, and ReleaseMutex by myself.
    My English is very bad. So tell me if Something I talked make u confuse.
    My Ebook Store: www.coding.vn/book.php

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How To Implement Mutex In Windows

    Quote Originally Posted by zkidkid View Post
    I just want to implement 3 above functions like CreateMutex,OpenMutex, and ReleaseMutex by myself.
    Can I ask why?

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: How To Implement Mutex In Windows

    Quote Originally Posted by zkidkid View Post
    I just want to implement 3 above functions like CreateMutex,OpenMutex, and ReleaseMutex by myself.

    WElcome in the world of "reinvent the wheel"!

    And I'm afraid, you won't get much help in that...
    Victor Nijegorodov

  6. #6
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: How To Implement Mutex In Windows

    Currently, I want to implement it by myself so I have google it but I found nothing.
    Actually, I doubt there is any sense in trying to implement Windows kernel object functionality in user mode. Or did you mean you are ready to break into the kernel?

    What should I do to solve this problem ?
    Do you qualify this as problem? May I ask you why?
    Best regards,
    Igor

  7. #7
    Join Date
    Oct 2008
    Posts
    116

    Re: How To Implement Mutex In Windows

    hi, thanks for your quick answer.

    Cause it's a question from my friend. He had an interview from Aricent Company. And he asked me for the solution. But I know nothing.

    My English is very bad. So tell me if Something I talked make u confuse.
    My Ebook Store: www.coding.vn/book.php

  8. #8
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How To Implement Mutex In Windows

    Quote Originally Posted by zkidkid View Post
    hi, thanks for your quick answer.

    Cause it's a question from my friend. He had an interview from Aricent Company. And he asked me for the solution. But I know nothing.

    The correct interview answer would be to describe how to use the CreateMutex et. al. family of api's. You could go on to say that implementing them would be pointless since the system provides them for you.

  9. #9
    Join Date
    Nov 2008
    Location
    England
    Posts
    748

    Re: How To Implement Mutex In Windows

    If i'm reading this correctly, you are asking how if you were to write a kernal you would provide mutexes. The commonly used algorithms are Dekkers and Petersons.
    Get Microsoft Visual C++ Express here or CodeBlocks here.
    Get STLFilt here to radically improve error messages when using the STL.
    Get these two can't live without C++ libraries, BOOST here and Loki here.
    Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
    Always use [code] code tags [/code] to make code legible and preserve indentation.
    Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured