Home | History | Annotate | Download | only in benchmarks

Lines Matching refs:scheduler

48   var scheduler = new Scheduler();
49 scheduler.addIdleTask(ID_IDLE, 0, null, COUNT);
53 scheduler.addWorkerTask(ID_WORKER, 1000, queue);
58 scheduler.addHandlerTask(ID_HANDLER_A, 2000, queue);
63 scheduler.addHandlerTask(ID_HANDLER_B, 3000, queue);
65 scheduler.addDeviceTask(ID_DEVICE_A, 4000, null);
67 scheduler.addDeviceTask(ID_DEVICE_B, 5000, null);
69 scheduler.schedule();
71 if (scheduler.queueCount != EXPECTED_QUEUE_COUNT ||
72 scheduler.holdCount != EXPECTED_HOLD_COUNT) {
74 "Error during execution: queueCount = " + scheduler.queueCount +
75 ", holdCount = " + scheduler.holdCount + ".";
94 * A scheduler can be used to schedule a set of tasks based on their relative
99 function Scheduler() {
120 * Add an idle task to this scheduler.
126 Scheduler.prototype.addIdleTask = function (id, priority, queue, count) {
131 * Add a work task to this scheduler.
136 Scheduler.prototype.addWorkerTask = function (id, priority, queue) {
141 * Add a handler task to this scheduler.
146 Scheduler.prototype.addHandlerTask = function (id, priority, queue) {
151 * Add a handler task to this scheduler.
156 Scheduler.prototype.addDeviceTask = function (id, priority, queue) {
167 Scheduler.prototype.addRunningTask = function (id, priority, queue, task) {
173 * Add the specified task to this scheduler.
179 Scheduler.prototype.addTask = function (id, priority, queue, task) {
186 * Execute the tasks managed by this scheduler.
188 Scheduler.prototype.schedule = function () {
204 Scheduler.prototype.release = function (id) {
220 Scheduler.prototype.holdCurrent = function () {
230 Scheduler.prototype.suspendCurrent = function () {
241 Scheduler.prototype.queue = function (packet) {
285 * be started by the scheduler.
363 * @param {Scheduler} scheduler the scheduler that manages this task
368 function IdleTask(scheduler, v1, count) {
369 this.scheduler = scheduler;
376 if (this.count == 0) return this.scheduler.holdCurrent();
379 return this.scheduler.release(ID_DEVICE_A);
382 return this.scheduler.release(ID_DEVICE_B);
393 * @param {Scheduler} scheduler the scheduler that manages this task
396 function DeviceTask(scheduler) {
397 this.scheduler = scheduler;
403 if (this.v1 == null) return this.scheduler.suspendCurrent();
406 return this.scheduler.queue(v);
409 return this.scheduler.holdCurrent();
419 * @param {Scheduler} scheduler the scheduler that manages this task
424 function WorkerTask(scheduler, v1, v2) {
425 this.scheduler = scheduler;
432 return this.scheduler.suspendCurrent();
446 return this.scheduler.queue(packet);
456 * @param {Scheduler} scheduler the scheduler that manages this task
459 function HandlerTask(scheduler) {
460 this.scheduler = scheduler;
482 return this.scheduler.queue(v);
487 return this.scheduler.queue(v);
490 return this.scheduler.suspendCurrent();