Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-2490

[C++] input stream locking inconsistent

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.9.0
    • 0.15.0
    • C++

    Description

      Reading from the current file pointer is inherently thread-unsafe, since the file pointer may be updated by another thread (either before or during the operation). However, currently, we have:

      • ReadableFile::Read takes a lock
      • MemoryMappedFile::Read doesn't take a lock
      • BufferReader::Read doesn't take a lock

      We could always take a lock in Read. But I don't think there's a pattern where it's useful to call Read from multiple threads at once (since you're not sure where the file pointer will be exactly when the read starts). So we could as well specify that Read isn't thread-safe and let people make sure they don't call it from multiple threads.

      Attachments

        Issue Links

          Activity

            People

              apitrou Antoine Pitrou
              apitrou Antoine Pitrou
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 6h 20m
                  6h 20m