Virtual Round Robin with Typescript
While i was studying at my university I had a subject, operating systems, and there they taught me about planning protocols where the CPU takes a process to execute but with priorities. In this explanation appear Virtual Round Robin.
Some sites where the normal round robin is explained to take more context of the algorithm.
By learning it I understood how it works and I decided to do it in code. I work with Typescript and for this I took this language.
A short explications of differences between Round Robin and Virtual Round Robin is that the CPU takes process/threads of two queues to be processed:
1 — Ready queue: Process/Threads where are waiting for be taken.
2 — Aux Queue(Random Name): Process/Threads where their bursts in and out ended and are waiting for be taken.
The algorithm takes the first process / threads from the Aux queue, but if there are none, it takes from the ready queue.