Documentation

LeanPool.OrderMaintenance.Model.PQ

Level F: the bucket priority queue (prototype/pq.py) #

Quiet chunks with size > theta, in buckets indexed by size. A bucket is a doubly linked list of chunks (pqHead, pqNext, pqPrev), pushed and popped at its head, so pop_max takes the most recently added chunk of the largest bucket. Non-empty buckets form a sorted doubly linked list (nbNext, nbPrev, pqLo, pqHi). Bucket and chunk "none" is 0: sizes in the queue exceed theta ≥ 1.

Test whether the priority queue has any nonempty bucket.

Equations
Instances For

    Make empty bucket s non-empty, right after non-empty bucket p (0: new minimum).

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Push a chunk into a bucket, linking the bucket after its predecessor if it was empty.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Remove a queued chunk and unlink its bucket if the bucket becomes empty.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Insert c at bucket s, scanning downward for the predecessor bucket (the slow path; it is never taken when s = theta + 1).

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            The size of quiet chunk c changed from old to new.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Queue a chunk exactly when its size exceeds the quiet-chunk threshold.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Remove and return the head chunk of the largest nonempty bucket.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For