Visit the LQ Articles and Editorials section
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-19-2011, 04:18 AM   #1
vishnu anand
LQ Newbie
Registered: Dec 2011
Posts: 12

Rep: Reputation: Disabled
mutex vs semaphore

what is difference between mutex and semaphore?? in which case do we use mutex and in which case we use semaphore??
Old 12-19-2011, 04:41 PM   #2
LQ Newbie
Registered: Apr 2006
Location: FL
Distribution: Used to be slack, fedora(sometimes), now arch
Posts: 15

Rep: Reputation: 1
Originally Posted by vishnu anand View Post
what is difference between mutex and semaphore?? in which case do we use mutex and in which case we use semaphore??
They are basically the same thing. They are both used to control access to a resource. The main difference is that a mutex is set or not set, where a semaphore is typically assigned an interger n that allows n number of concurrent accesses before access is denied.

There are a bunch of decent guides on mutexes/semaphores. Here is one -->
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mutex v/s Semaphore jayadhanesh Linux - Software 3 12-07-2010 01:20 AM
Mutex new2lunix Programming 1 12-02-2008 09:12 PM
Mutex attributes? estratos Programming 12 12-24-2006 04:54 AM
difference mutex vs. semaphore? Thinking Programming 1 11-16-2005 06:26 AM
Whats the difference between a Mutex and a Semaphore? The_Nerd Programming 3 07-07-2004 10:28 AM

All times are GMT -5. The time now is 08:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration