struct SchedState {
buckets: Vec<BucketState>,
demand: Vec<u64>,
credits: Vec<u32>,
parked: Vec<Option<Gate>>,
}Expand description
The scheduler’s mutable half.
Fields§
§buckets: Vec<BucketState>One per ShapeProfile::buckets entry, in configured order.
demand: Vec<u64>How many stream queues currently hold an unreleased head of this class. The demand a discipline arbitrates over.
Maintained by PendingQueue, which declares its head’s class and
withdraws on every path that can retire one — including clear,
the teardown drain and Drop. A leaked declaration would starve a
lower class for the rest of the session, which is why the withdrawal
is a Drop obligation and not a list of call sites.
credits: Vec<u32>Releases remaining in this round, per class, under
Discipline::WeightedRoundRobin. Refilled to
ClassRule::weight when every class with
demand in a bucket has spent its own.
parked: Vec<Option<Gate>>The gate each starved class is parked on, or None when it is not
parked. Taken and released by whoever makes the class eligible.