I need to develop the
awake() functions of the OS.
I have runningJobs queue, and sleepingJobs queue. The sleep method should receive a Job and insert it in the sleeping queue in the right place, and the
awake() method should move the sleeping jobs that are ready to run, to the runningJobs queue.
awake()method would know the time without having access to the current time
Linked list is a “first in first out” queue. The first job to sleep is the one that has been running the longest. The first job to awake is the one that has been asleep the longest.
Priority queue will let you have different execution priorities: the lowest priority process will sleep first, the highest priority process will awake first.
Don’t reorder the queues externally, trust the data structure to do it itself.
Presumably your os simulator has a clock of its own, which you can use instead of the real world clock time.