There is very thin line of difference between semaphore and mutex,, mutex are like binary semaphore ,,but the are concerned about execution of any piece of code (critical section) ,where as a semaphore is program construct which can be used to just hold a lock on a set of resources .
As said by Ankit , thread/process which acquires a lock on mutex , is the only one to unlock it .. On 6/17/11, ankit sambyal <[email protected]> wrote: > Yes, even the threads of a single process cannot have access to each > others mutex. > Mutexes can be applied only to threads in a single process and do not > work between processes as do semaphores. > > > > > > On Fri, Jun 17, 2011 at 5:40 AM, Akshata Sharma > <[email protected]> wrote: >> When a thread locks a mutex only it can unlock it. Does this implies that >> even the threads of a single process cannot have access to each others >> mutex? I mean, if a thread A of process P has acquired a mutex, then only >> thread A can release it or a thread B of same process P can also release >> it? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Lalit Kishore Sharma, IIIT Allahabad (Amethi Capmus), 6th Sem. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
