From: matz@... (Yukihiro Matsumoto) Date: 2000-02-01T00:32:54+09:00 Subject: [ruby-talk:01211] Re: File#flock In message "[ruby-talk:01210] Re: File#flock" on 00/01/31, ts 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.