(j3.2006) synchronizing I/O
Robert Corbett
Robert.Corbett
Tue Feb 10 19:21:07 EST 2009
John Reid wrote:
> Robert Corbett wrote:
>
>>John Reid wrote:
>>
>>
>>>Robert Corbett wrote:
>>>
>>>
>>>>The second paragraph of Section 13 of WG5/N1762 says that
>>>>Fortran 2008 processors must implement record-level
>>>>synchronization for OUTPUT_UNIT and ERROE_UNIT. I have
>>>>not found language in the draft standard that specifies
>>>>that requirement. Have I missed it, or is the language
>>>>yet to be added?
>>>
>>>
>>>
>>>We seem to have somehow lost this bullet point that was in 9.3.3.2 of
>>>08-007:
>>>
>>>"Each record shall be read or written by a single image. The processor
>>>shall ensure that once an image commences transferring the data of a
>>>record to the file, no other image transfers data to the file until
>>>the whole record has been transferred."
>>
>>I assume no other image could do an ALL STOP, a BACKSPACE, a CLOSE,
>>a FLUSH, some INQUIREs, an OPEN, or a REWIND either. It might be
>>argued that an endfile record is data, so the statement above might
>>cover that case. A WAIT and most forms of INQUIRE might be OK,
>>depending on how I/O synchronization is implemented.
>>
>>Bob Corbett
>
>
> I don't think there is any problem with ALL STOP, which initiates error
> termination. [32:15-16] says "If an image initiates error termination, all other
> images that have not already initiated termination initiate error termination."
In every implementation of which I am aware, STOP causes I/O buffers to
be flushed. I assume ALL STOP would do the same. Thus, executing an
ALL STOP statement includes the equivalent of doing a FLUSH on each unit
for which the last I/O operation was a write.
> Yes, we have overlooked the other cases. I would never dream of doing any of
> them to default output or error output.
Recall that one of the "selling points" for adding OUTPUT_UNIT and
ERROR_UNIT to the standard was that people wanted to be able to close
those units and reopen them on other files.
Bob Corbett
More information about the J3
mailing list