Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!ucbvax!agate!usenet From: bks@alfa.berkeley.edu (Brad Sherman) Newsgroups: comp.unix.wizards Subject: Need help with lockf(),open(..., O_SYNC), fsync() on SUN's Message-ID: <1991Mar20.205800.14651@agate.berkeley.edu> Date: 20 Mar 91 20:58:00 GMT Sender: usenet@agate.berkeley.edu (USENET Administrator) Organization: University of California, Berkeley Lines: 27 [If this is the wrong group, I apologize and would appreciate a pointer to the right one.] On both a Sun3 (3.5) network and a SparcStation (4.1) network we are experiencing file synchronization difficulties. Two processes on the same cpu work fine but separate clients, or client and server seem to fail to work to spec. * A Process blocks waiting to aquire file1 via an exclusive lock (lockf()). * After gaining the lock, a record in file2 is read and written. * An fsync() is issued on file2. * The lock is then released on file1. The problem: When running this process on two separate cpu's it seems that a read by one client occasionally does not reflect the last write by the other process, despite the fsync(). The locking/unlocking of file1 (and blocking caused by it) works fine. Adding an O_SYNC (on sparc's) to the open() calls does not help. No other processes are touching file1 or file2. This is with the standard SUN distributed C compilers and libraries. Are we doing something wrong here? ------------------------------- Brad Sherman (bks@alfa.berkeley.edu)