Skip to content

Tag: operating-system

Implement the `sleep()` and `awake()` in java

I need to develop the sleep() and 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. I…

System stack allocation in recursion

As we all know that all most all recursive functions can be modified to iterative approach. Suppose we take an example of adding two linklists which represent two huge numbers. This question can be solved either by recursion (which uses system stack) or iterative (explicit stack usage) approach. My doubt here…