Christopher Masto wrote: > > How about a little timing difference? > > User 1 User 2 > > open file > read file > open file > lock file (blocks?) > close file > lock returns open file (blocks) > diddle file > unlock file > scribble over User 1's changes > > What I'm getting at is that if User 2 has to do something special > anyway, it might as well be using advisory locking.
You've got this so wrong, perhaps you should just go find a System V man page and read about mandatory locking before embarassing yourself any- more. Locking will only block if another process is holding an overlapping lock. opening won't block due to mandatory locking. The only operations that can block are read and write, and then only if the read or write operation will overlap a locked range of bytes. Your example above is a perfect example of a poorly written program doing something stupid. If you allow poorly written programs to do stupid things on top of YOUR critical data files, that is your problem. Not having mandatory locking is OUR problem. If you don't want it, just leave "option LOCKING" out of your kernel. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://softweyr.com/ w...@softweyr.com To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-hackers" in the body of the message