Implementation of a scheduler with priority queues.