Changes between Initial Version and Version 2 of Ticket #10920


Ignore:
Timestamp:
2015-01-04T15:04:02+01:00 (8 years ago)
Author:
holgermappt
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10920

    • Property Summary changed from Stop image thumbnail loading if thumbnails are not shown to [patch] Stop image thumbnail loading if thumbnails are not shown
  • Ticket #10920 – Description

    initial v2  
    11Here is a patch that adds the function `stopLoadThumbs()` that stops geo image thumbnail loading if thumbnails are not needed anymore.  The thumbnail load is continued the next time `loadThumbs()` is called.  The JOSM revision needs to be inserted for function `stopLoadThumbs()` (`@since tbd`).
    22
    3 Please review the thread synchronization, my experience in that area is limited.  I think a new thumbnail loader should wait if another loader is still running, but I don't know how that can be done.
     3Please review the thread synchronization, my experience in that area is limited.  I think a new thumbnail loader should wait if another loader is still running, but such an implementation might be too complicated compared to the actual problem.
    44
    55One corner case is a sequence of `setUseThumbs(true); setUseThumbs(false); setUseThumbs(true); ...`.  That would start multiple threads, each thread with a new ThumbsLoader instance.  They potentially all work on the same image in parallel.  Most of the loaders will stop after they processed one file.
    66
    7 An other corner case is a layer merge while thumbnails are loaded.  The problem here is that thumbnails are switched off if the other layer is still loading thumbnails (thumbnail loading must be stopped for the other layer because we will lose control over the thumbnail loader of the other layer).  That might be unexpected to the user.  I have no idea how a running thumbnail loader can be migrated from one layer to another.
     7An other corner case is a layer merge while thumbnails are loaded.  The thumbnail loaders are stopped on both layers in that case.  `thumbsLoaded` will be false in that case and the next `paint()` will continue to load thumbnails if `useThumbs` is true.
    88
    99The patch originates from ticket:10854.