can we use mutex for synchronization?
if yes why?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
Mutexes are used for synchronisation.
Basically they allow only one process to access any shared memory at a time
thus helping sync among processes.
On Wed, Aug 17, 2011 at 9:29 PM, Aman Kumar amanas...@gmail.com wrote:
can we use mutex for synchronization?
if yes why?
--
You received
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?
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
akshatasharm...@gmail.com wrote:
When a thread
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