Class ADT.Scheduler

Inheritance graph
ADT.Heap ADT.Scheduler ADT.TreeScheduler
Description

This class implements a quantized resource scheduler.

Weighted consumers are added to the scheduler with add(), which returns a Consumer object.

When there's some of the resource available to be consumed the resource owner calls get(), which returns the Consumer that is to use the resource. Consumer()->consume() is then called with the fraction of the quanta that was consumed (typically 1.0). The amount of resources allocated to a consumer is proportional to the weight of the consumer.

A consumer may be temporarily deactivated (in which case it won't be returned by get(), but still retain its share of the resource which will be provided later by get() when it has been reactivated.


Inherit Heap

protected inherit .Heap : Heap