@Dumanshu/@Ankit: Of course mutexes can be made to work between processes (it's an implementation detail). But the *concept* of a mutex is Owner + (Lock & Key) pair. By adding the concept of Owner to a lock, we can ensure that only the person who locked the lock can open it. This *guarantees* mutual exclusion (which is unlike a semaphore). A semaphore is a signalling mechanism between threads/processes that simply indicates an event that has occured asynchronously to the process/thread's flow of control (for processes/threads other than the event generating process of-course). It is often used to indicate that cooperative progress may be possible on resources under contention or synchronization between states may be required. Any cooperating process/thread can modify the value of a semaphore which is not true of a mutex.
Note: Mutex and Semaphore are essentially concepts. Their implementations can vary in different systems and have different implementation constraints but the theory is clear. The two are different and serve different purposes though they may share implementation details. -- DK http://twitter.com/divyekapoor http://www.divye.in -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/ssXg1ahVXcgJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.