New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++] ReadAt/WriteAt are inconsistent with moving the files position #19211
Comments
Antoine Pitrou / @pitrou: |
Dimitri Vorona / @alendit: |
Antoine Pitrou / @pitrou: |
Wes McKinney / @wesm: |
Wes McKinney / @wesm: |
Wes McKinney / @wesm: |
Wes McKinney / @wesm: |
Antoine Pitrou / @pitrou:
or 2) Have an internal "positioning" lock that ensures that we can have several ReadAt or WriteAt calls simultaneously, but that implicitly positioning operations wait for the last *At call to end and to restore the file pointer. I'm not sure how easy #2 is, but should be doable. |
Antoine Pitrou / @pitrou: As a sidenote, Tensorflow's RandomAccessFile only supports ReadAt-like operation, not implicit positioning with Seek() or Tell(). See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/platform/file_system.h#L231 |
Antoine Pitrou / @pitrou: |
Right now, there is inconsistent behaviour regarding moving the files position pointer after calling ReadAt or WriteAt. For example, the default implementation of ReadAt seeks to the desired offset and calls Read which moves the position pointer. MemoryMappedFile::ReadAt, however, doesn't change the position. WriteableFile::WriteAt seem to move the position in the current implementation, but there is no docstring which prescribes this behaviour.
Antoine suggested that *At methods shouldn't touch the position and it makes more sense, IMHO. The change isn't huge and doesn't seem to break anything internally, but it might break the existing user code.
Reporter: Dimitri Vorona / @alendit
Assignee: Antoine Pitrou / @pitrou
PRs and other links:
Note: This issue was originally created as ARROW-2835. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: