<table><tr><td style="">wreissenberger added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D14942">View Revision</a></tr></table><br /><div><div><p>Hm, I think the reason is the strategy how the cache is updated and not a pure invalid cache problem.</p>

<p>Lets consider Job A and Job B having both the identical signatures with one Luminance frame, Job A starts before Job B, both run in two cycles. As a result of Job A finishing (if Job A does not get into trouble), we would expect <tt style="background: #ebebeb; font-size: 13px;">Lum-001.fits</tt>and <tt style="background: #ebebeb; font-size: 13px;">Lum-002.fits</tt>.</p>

<p>Now let's see what happens if the <strong>first</strong> of the two cycles of A is finished. Job A has produced <tt style="background: #ebebeb; font-size: 13px;">Lum-001.fits</tt> and returns to <tt style="background: #ebebeb; font-size: 13px;">evaluateJobs()</tt> which calls <tt style="background: #ebebeb; font-size: 13px;">updateCompletedJobsCount()</tt>. The latter one cycles over all sequence jobs. When it passes Job A (remember, it's the first one in the list), which is in the state JOB_EVALUATION, it calculates</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">newFramesCount["...Lum"] = getCompletedFiles("...Lum", ...) = 1</pre></div>

<p>After this, Job B is evaluated for the same signature <tt style="background: #ebebeb; font-size: 13px;">"...Lum"</tt>, but it uses another branch in the loop and takes the cached value</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">QMap<..> sigCount = capturedFramesCount.find("...Lum")
newFramesCount["...Lum"] = sigCount.value() = 0</pre></div>

<p>Since capturedFramesCount gets updated only after <strong>all</strong> sequence jobs have been evaluated, it takes the old value from the run before.</p>

<p>So we need a solution how the cache is updated accordingly. I think my solution is not bad, since it takes the maximum of the (old) cached value and a fresh calculated value. The alternative is avoiding cache access during the cache update completely.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R321 KStars</div></div></div><br /><div><strong>BRANCH</strong><div><div>improve__scheduler_image_update (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D14942">https://phabricator.kde.org/D14942</a></div></div><br /><div><strong>To: </strong>TallFurryMan, mutlaqja, wreissenberger<br /><strong>Cc: </strong>kde-edu, narvaez, apol<br /></div>