On Sat, 25 Feb 2012 07:48:24 +0000, Jeremy Nicoll - news posts
>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
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.