Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!umich!ox.com!heifetz!tbomb!time From: time@ice.com (Tim Endres) Newsgroups: comp.mail.misc Subject: Re: Will ELM ever use lockf()? Message-ID: <01CE0001.cmjkhe5@tbomb.ice.com> Date: 13 Apr 91 16:22:28 GMT Reply-To: time@ice.com Organization: ICE Engineering, Inc. Lines: 26 X-Mailer: uAccess - Mac Release: 1.1.b1 In article <1991Apr11.024849.29924@Veritas.COM>, tron@Veritas.COM (Ronald S. Karr) writes: > >Failure scenario: > > Process A owns lockfile - Processes B & C are contending for one. > > B reads A's PID from lockfile. > > A finishes, removes lockfile and exits. > > B sends signal 0 to A's PID, notes that process is gone. > > C notes that no lockfile is present and creates one. > > B removes lockfile (now belonging to C) and creates one. > > At this point both B and C think they have exclusive access to > > the mailbox. > > However, both smail3 and elm create the files using the O_EXCL flag, > indicating that the OS should ensure that only one of the two creates > should succeed. I do not understand this. If B is removing the lock file created by C, how would the O_EXCL flag stop B from creating its lockfile? tim. ------------------------------------------------------------- Tim Endres | time@ice.com ICE Engineering | uupsi!ice.com!time 8840 Main Street | Voice FAX Whitmore Lake MI. 48189 | (313) 449 8288 (313) 449 9208