LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-19-2011, 03: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, 03:41 PM   #2
markcole
LQ Newbie
 
Registered: Apr 2006
Location: FL
Distribution: Used to be slack, fedora(sometimes), now arch
Posts: 15

Rep: Reputation: 1
Quote:
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 -->http://www.yolinux.com/TUTORIALS/Lin...ixThreads.html
 
1 members found this post helpful.
  


Reply



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 12:20 AM
Mutex new2lunix Programming 1 12-02-2008 08:12 PM
Mutex attributes? estratos Programming 12 12-24-2006 03:54 AM
difference mutex vs. semaphore? Thinking Programming 1 11-16-2005 05:26 AM
Whats the difference between a Mutex and a Semaphore? The_Nerd Programming 3 07-07-2004 09:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:57 PM.

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