In message "[ruby-talk:01210] Re: File#flock"
    on 00/01/31, ts <decoux / moulon.inra.fr> writes:

|Y> No, File#flock is based on system call flock(2), which does not aware
|Y> of Ruby's threads.  For thread synchronization, use Mutex.
|
| I don't understand this case :

(snip)

I see.  File#flock can be used to exclude control flow within same
process (i.e. threads),  but since threads share memory space, threads
may share locked file descriptor.  On the other hand, there's no way
to share locked file descriptor between processes, thus

|  LOCK_EX 
|
|     Exclusive lock. Only one process may hold an exclusive lock for a
|                     ^^^^^^^^^^^^^^^^
|     given file at a given time.

And not "Only one thread".
Hope this helps.

							matz.