From: Emilio Tagua Date: 2007-05-02T05:27:18+09:00 Subject: Re: What's a Mutex and how do I use it? On 5/1/07, web.dizign@gmail.com wrote: > Mutex seems very powerful and something I could use eventually as I > better my understanding of ruby. Thus far, I haven't found the > documentation verbose enough for me to grasp the concept of it. Could > anyone try their hand at writing a piece (or a reply) that would help > totally demistify this thing called a Mutex? Maybe a simple use case > scenario or maybe just 2 or 3 different ways of using it... that would > be enough for me to understand. Thanks! > Hi, Mutex comes for Mutual Exclusion. This means that 2 or more elements (process, threads, whatever) is trying to take the control or use a resource, and this may cause an error because its a called "critical section". So the class Mutex gives you the lock for you to protect that resource when doing concurrent programming. Hope you understand me, im not the greatest teacher. More information @: http://en.wikipedia.org/wiki/Mutual_exclusion Easy examples @: http://www.rubycentral.com/book/tut_threads.html