Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!sgi!shinobu!odin!thestepchild!rhartman From: rhartman@thestepchild.sgi.com (Robert Hartman) Newsgroups: comp.unix.shell Subject: Re: Creating a lock file in csh? Message-ID: <1991Apr17.183652.12420@odin.corp.sgi.com> Date: 17 Apr 91 18:36:52 GMT References: <1991Apr15.205654.26253@unhd.unh.edu> <1991Apr16.175347.1082@odin.corp.sgi.com> <1991Apr17.102654.4476@athena.mit.edu> Sender: news@odin.corp.sgi.com (Net News) Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 20 In article <1991Apr17.102654.4476@athena.mit.edu> jik@athena.mit.edu (Jonathan I. Kamens) writes: > >Let's assume that two processes are trying to get a lock in this way at >the same time over NFS. There is no way in the NFS protocol to open a file >for write if it does not exist in an atomic operation. Therefore, NFS client >kernels first have to check with the server to see if the file exists, and >send a request to create it if it doesn't. So here's what could happen: > > [ description of resulting race condition omitted ] > >-- >Jonathan Kamens USnail: Thank you Jonathan! I guess the real solution would be for someone to write a "lock" command that makes the NFS lock manager accessible at the user level. Don't think I'll hold my breath though ... ;^) -r