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.

what is difference between binary semaphore & mutex

Status
Not open for further replies.

smartshashi

Member level 4
Joined
Aug 11, 2004
Messages
68
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
513
difference between binary semaphore and signals

i m not getting clear what is difference between binary semaphore & mutex. we set attributes for mutex means what actually we do. please explain this or tell me related stuff on internet
 

difference between binary semaphore and mutex

"Mutexes are typically used to serialise access to a section of re-entrant code that cannot be executed concurrently by more than one thread. A mutex object only allows one thread into a controlled section, forcing other threads which attempt to gain access to that section to wait until the first thread has exited from that section."


A semaphore restricts the number of simultaneous users of a shared resource up to a maximum number. Threads can request access to the resource (decrementing the semaphore), and can signal that they have finished using the resource (incrementing the semaphore)."


with respect to binary semaphore and mutex are one and the same....

as for as mutex attributes are considered its an in built function used by the pthread APIs to initalize some datastructures...

Any of the pthreads data structures which are used to specify the initial states when creating certain resources (threads, mutexes, and condition variables). To create a thread, you can use a thread attribute object. To create a mutex, you use a mutex attributes object. To create a condition, you can use a condition attributes object. Functions that create attribute objects are pthread_attr_init(), pthread_mutexattr_init(), pthread_condattr_init().
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top