From: Mike Hall Date: 2003-10-07T08:23:11+09:00 Subject: Re: bug in open/flock ? Ara.T.Howard wrote: >On Tue, 7 Oct 2003, Hal Fulton wrote: >flocks are durable across processes. I sure hope not! If the process goes away, its locks better disappear, too! > i think they are held in the kernel open file table. I've seen them in their own tables (SVR4). >> Ruby threads all run in the same process. "Yeah, baby!" (in an Austin Powers dialect). >which is an even stronger argument for why no two threads (let alone >processes) should EVER be able to obtain an exclusive lock at the same time. No, once a process has an exclusive lock, it's free to put additional exclusive locks on it. It "owns" the file now, so to speak. Also, many locking mechanisms are merely advisory, not mandatory. In Linux, the filesystem has to be mounted with a special flag to allow actual exclusive file locks. I know that's not the issue here; I was just pointing out a certain case.