Uploaded image for project: 'Spatial Information Systems'
  1. Spatial Information Systems
  2. SIS-487

Define a synchronization policy for WritableRenderedImage

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1
    • None
    • Features
    • None

    Description

      Apache SIS 1.1 provides a ComputedImage class which manages automatically the synchronization locks for computeTile(tileX, tileY) invocations. However we currently have no synchronization mechanism if users invoke getWritableTile(tileX, tileY) method and writes themselves in the image (outside computeTile(tileX, tileY) method).

      We could easily use ReentrantLock in getWritableTile(…) / releaseWritableTile(…) methods since those two methods shall be invoked in pairs. But this lock would not be fully effective, because we would also need to acquire/release lock in getTile(…) method (for read-only raster) but have no easy way of doing that. The problem is that there is no releaseTile(…) method for raster acquired in read-only mode.

      Some possible actions are:

      • Copy-on-write strategy: getWritableTile(…) returns a copy of the tile and that copy replaces the original tile when releaseWritableTile(…) is invoked. Inconvenient is that this strategy may have signification performance and memory impact because of potentially large amount of copy operations.
      • User responsibility: Provides a ReadWriteLock per image and let users do the synchronization themselves.

      An advantage of the user responsibility approach is that we could use a single ReadWriteLock for the whole image. It would allow image-wide consistency when a write operation may require writing in more than one tile. By contrast the copy-on-write strategy would not ensure such image-wide consistency since it would be done on a tile-by-tile basis only.

      Attachments

        Activity

          People

            Unassigned Unassigned
            desruisseaux Martin Desruisseaux
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: