Mutex vs Semaphore
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.”
Semaphores – “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).”
Ref: http://geekswithblogs.net/shahed/archive/2006/06/09/81268.aspx
Advertisement
Explore posts in the same categories: Uncategorized