View Single Post
  #14 (permalink)  
Old 02-26-2012, 04:58 AM
Swifty
Guest
 
Posts: n/a
Default Re: Bug 3274050 and 4.1.1 beta

On Sat, 25 Feb 2012 07:48:24 +0000, Jeremy Nicoll - news posts
<jn.nntp.scrap007@wingsandbeaks.org.uk> wrote:

>Is that because you're only writing a single line? If so it'd imply that
>the writing of a line is an atomic process in the file system and possibly
>the OS. I don't see why it should be though - I think I thought unix files
>were just character streams.


Each call to my logging code results in a single LINEOUT, or in some
cases a single CHAROUT, but I'll avoid saying that I'm writing a
single line as the string passed to the logging code may contain
embedded linends (I'm ignoring record-based file systems). The
resultant entries are never interspersed, so these are indeed atomic
filesystem actions.

One very important aspect is that it is crucial to open the output
with the "APPEND" option. This seems to force REXX to use a single
buffer, but I have no idea how this effect is achieved internally.
Without the APPEND option, competing threads may lose lines of output.

This was also one of the reasons for writing my test program. I knew
that an implicit open, or a simple "open write" would lead to loss of
entries, and someone suggested the APPEND option.
The documentation on the APPEND option implied that it would do what I
needed, but I like to be sure that it works in practice. Over a period
of about 10 years, I've seen no evidence of any failures.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Reply With Quote