olabusayoT commented on code in PR #1717:
URL: https://github.com/apache/daffodil/pull/1717#discussion_r3866724563


##########
daffodil-core/src/main/scala/org/apache/daffodil/runtime1/processors/SuspensionTracker.scala:
##########
@@ -42,20 +59,20 @@ class SuspensionTracker(suspensionWaitYoung: Int, 
suspensionWaitOld: Int) {
 
   /**
    * Attempts to evaluate suspensions. Old suspensions are evaluated less
-   * frequently than young suspensions. Any young suspensions that fail to
-   * evaluate are moved to the old suspensions list. If we evaluate old
-   * suspensions, we attempt to evaluate them first, with the hope that their
-   * resolution might make the young suspensions more likely to evaluate.
+   * frequently than young suspensions. A suspension with isWaitingOnWaiter
+   * true has a targeted wake-up already registered, so it's parked here
+   * instead of wasting a retry on it.
    */
-  def evalSuspensions(): Unit = {
+  def evalSuspensions(): Unit = evalSuspensionsThrottled()
+
+  private def evalSuspensionsThrottled(): Unit = {
     if (count % suspensionWaitOld == 0) {
-      evalSuspensionQueue(suspensionsOld)
+      evalSuspensionQueue(suspensionsOld, skipWaiters = true)
+      evalParkedSuspensions()

Review Comment:
   PArked suspensions need a final sweep because some suspensions only become 
resolvable through cumulative progress that no single DOS event ever announces. 
   
   The concrete example is a DOS-splitting chain's cumulative length, which can 
become computable as a side effect of many unrelated DOS transitions 
collectively, without any one of them being "the" event this suspension 
registered for. So for mos cases where an individual state change could resolve 
a suspension, the parked suspensions get evauated only when notified, but these 
captures the leftovers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to