From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,71dc3ff9d9cd593c X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-11-16 15:06:26 PST Newsgroups: comp.sys.dec Path: gmd.de!xlink.net!howland.reston.ans.net!darwin.sura.net!news-feed-2.peachnet.edu!concert!decwrl!adobe!kolling From: kolling@adobe.com (Karen Kolling) Subject: Re: HELP NEEDED: SHARING STREAMS FILES Message-ID: <1993Nov16.201226.8471@adobe.com> Keywords: vms, share, flush Sender: usenet@adobe.com (USENET NEWS) Organization: Adobe Systems Incorporated, Mountain View References: <1993Nov15.155720.5995@hns.com> <2cb06i$coj@jac.zko.dec.com> Date: Tue, 16 Nov 1993 20:12:26 GMT In article <2cb06i$coj@jac.zko.dec.com> cowan@btgmax.zko.dec.com (Ken Cowan) writes: > >In article <1993Nov15.155720.5995@hns.com>, oneil@hns.com (Pat O'Neil) writes: >|> >|>I'm having trouble with VMS V5.5-1 and sharing of STREAMS files. >|>I have two processes accessing a shared file. I'm using VMS locks >|>to control access to the file. Unfortunately, changes made by one >|>process aren't always immediately visible to the other process. >|>The application is in C. Both processes open the file for >|>shared access. What good is sharing a file between two processes >|>if changes by one process are not apparent to the other? > >The C RTL buffers data. Assuming you use fflush and fsync >to get the file system coherent, you still have to content with >the C RTL. I recently made a fix so that fflush flushes the >data it has read, in addition to the data that is pending for >writes. This change may appear in OpenVMS VAX V6.1 (though it >is not yet in the master source pool). > >If you really want to workaround this, you could play with >various fseek() operations. I'd guess that seeking to the >beginning of the file (or the end) and then seeking back >to your current position would work (as long as the file is >longer than a buffer's worth). Calling setvbuf might also >have the side effect of flushing the cache. What happens if he closes the file each time before he releases the lock? Would that get rid of the buffered clean data? Would the overhead of closing and re-opening the file make this prohibitive? -- Karen Kolling kolling@adobe.com or kolling@netcom.com ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^