Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Semaphore vs mutex in os environment

Status
Not open for further replies.

chandu.kurapati

Full Member level 3
Full Member level 3
Joined
Oct 31, 2013
Messages
186
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Location
Bengaluru, India
Activity points
2,778
Semaphore vs mutex in os enviorlment

Hi,
I'm beginner to the linux environment trying to understand the internals, now looking in to semaphore and mutex concept.

I understood the mutex and semaphore, but in real programming world in which scenario we will go for semaphore & in which scenario we will go for mutex.

can you please elaborate about semaphore & mutex.

Thanks & Regards,
Chandu.Kurapati.
 

Re: Semaphore vs mutex in os enviorlment

Hi there,

A mutex really stands for mutual-exclusion. It surrounds a ressource so that it's locked before and released after. Also, the OS is aware of that, so it puts threads/processes waiting for it sleep and wakes them when they're released.

A semaphore is more like a barrier to me. It's a synchronization mecanism. It's a way for a thread/process to wait for a condition, before it enters a code segment

Hope it helps.
Laurent
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top