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().