Message from JavaScript discussions

September 2017

— Well, you could still round robin

— 

"Round-robin algorithm is a pre-emptive algorithm as the scheduler forces the process out of the CPU once the time quota expires."

— Just always give the process that has gone without activity the longest most priority

— That is aging, something I was just adding

— "Highest response ratio next (HRRN) scheduling is a non-preemptive discipline, similar to shortest job next (SJN), in which the priority of each job is dependent on its estimated run time, and also the amount of time it has spent waiting."

Message permanent page

— But that could be the ONLY condition

— I never read about scheduling before, haha

— I may have misinterpreted round robin

— I just meant iterating around the list of processes

— And giving them control

— 

Dispatcher.prototype.delegate = function () {

  const timings = [];

  var proc;

  _delegate: for (var loc = 0; proc = this.queue[loc], !this.halt && loc < this.queue.length; loc++) {

    if (proc === null) {

      continue;

    }

    timings[loc] = process.hrtime();

    var sysCall = proc.instance.next(proc.events);

    timings[loc] = process.hrtime(timings[loc])

    timings[loc][1] = proc;

    proc.events.length = 0;

    if (sysCall.done) {

      this.queue[loc] = null;

    }

    if (sysCall.value !== undefined) {

      this.sysCallHandler(sysCall.value);

    }

  }

  return timings;

};

Message permanent page

— 

Dispatcher.prototype.run = function () {
if (!this.halt && this.procs.size > 0) {
this.running = true;
}
_cycle: while (!this.halt && this.procs.size > 0) {
this.scheduler.opt(this.delegate());
}
this.running = false;
};

Message permanent page