* HELP NEEDED: SHARING STREAMS FILES
@ 1993-11-15 15:57 Pat O'Neil
1993-11-15 19:19 ` Karen Kolling
1993-11-16 16:47 ` Ken Cowan
0 siblings, 2 replies; 5+ messages in thread
From: Pat O'Neil @ 1993-11-15 15:57 UTC (permalink / raw)
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?
--
Pat O'Neil
Hughes Network Systems
Germantown, Md
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: HELP NEEDED: SHARING STREAMS FILES
1993-11-15 15:57 HELP NEEDED: SHARING STREAMS FILES Pat O'Neil
@ 1993-11-15 19:19 ` Karen Kolling
1993-11-16 16:47 ` Ken Cowan
1 sibling, 0 replies; 5+ messages in thread
From: Karen Kolling @ 1993-11-15 19:19 UTC (permalink / raw)
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?
I'm not familiar with that area of VMS, but as a file systems weenie,
I'll hazard a guess that the changes are often still in an unshared
cache and about to/in the process of going out to disk when the
next process gets the lock and does a read, and what you need to do
is have each process do the equivalent of a UNIX flush (write all
dirty pages to disk) operation (and be sure it completes) before the
process releases the lock.
--
Karen Kolling kolling@adobe.com or kolling@netcom.com
^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: HELP NEEDED: SHARING STREAMS FILES
1993-11-15 15:57 HELP NEEDED: SHARING STREAMS FILES Pat O'Neil
1993-11-15 19:19 ` Karen Kolling
@ 1993-11-16 16:47 ` Ken Cowan
1993-11-16 20:12 ` Karen Kolling
1 sibling, 1 reply; 5+ messages in thread
From: Ken Cowan @ 1993-11-16 16:47 UTC (permalink / raw)
In article <1993Nov15.155720.5995@hns.com>, oneil@hns.com (Pat O'Neil) writes:
|>Newsgroups: comp.sys.dec
|>Path: jac.zko.dec.com!crl.dec.com!pa.dec.com!decwrl!olivea!sgigate.sgi.com!sgiblab!wetware!spunky.RedBrick.COM!psinntp!hns!oneil
|>From: oneil@hns.com (Pat O'Neil)
|>Subject: HELP NEEDED: SHARING STREAMS FILES
|>Sender: news@hns.com (USENET news system)
|>Message-ID: <1993Nov15.155720.5995@hns.com>
|>Date: Mon, 15 Nov 93 10:57:20 EST
|>Organization: Hughes Network Systems Inc.
|>Keywords: vms, share, flush
|>Lines: 11
|>
|>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?
|>--
|>Pat O'Neil
|>Hughes Network Systems
|>Germantown, Md
|>
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.
--
Ken Cowan, ZK2-3/Q8 cowan@rtl.enet.dec.com
Digital Equipment Corporation decwrl!rtl!cowan
110 Spit Brook Rd,
Nashua, NH 03062
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: HELP NEEDED: SHARING STREAMS FILES
1993-11-16 16:47 ` Ken Cowan
@ 1993-11-16 20:12 ` Karen Kolling
1993-11-16 20:56 ` Karen Kolling
0 siblings, 1 reply; 5+ messages in thread
From: Karen Kolling @ 1993-11-16 20:12 UTC (permalink / raw)
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
^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: HELP NEEDED: SHARING STREAMS FILES
1993-11-16 20:12 ` Karen Kolling
@ 1993-11-16 20:56 ` Karen Kolling
0 siblings, 0 replies; 5+ messages in thread
From: Karen Kolling @ 1993-11-16 20:56 UTC (permalink / raw)
In article <1993Nov16.201226.8471@adobe.com> kolling@adobe.com (Karen Kolling) writes:
>In article <2cb06i$coj@jac.zko.dec.com> cowan@btgmax.zko.dec.com (Ken Cowan) writes:
>>
>>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?
Actually, closing and opening the file would presumably also make the
extra locking unnecessary. I'm a little slow this morning :-)
--
Karen Kolling kolling@adobe.com or kolling@netcom.com
^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^ ^._.^
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1993-11-16 20:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-11-15 15:57 HELP NEEDED: SHARING STREAMS FILES Pat O'Neil
1993-11-15 19:19 ` Karen Kolling
1993-11-16 16:47 ` Ken Cowan
1993-11-16 20:12 ` Karen Kolling
1993-11-16 20:56 ` Karen Kolling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox