Hey I am just trying connect my learning in Operating System subject and python programing. When I run time.sleep(10)
what exactly happens behind the scene. My confusion here is if CPU needs to keep track that a particular process needs to be awaken after 10 seconds how does it do that. So what exactly the mechanism by which OS keeps track that after 10 second this process needs to awake.
Below are few questions:
1) Does really a context switch happens i.e. process is sent to waiting state in ready queue or not when a python program runs time.sleep(10)
instruction?
2) From the point of context switch to bringing back the process to CPU in between i.e. before 10 second, does the CPU spends any CPU cycle for that process?