In my previous question How does the kernel scheduler know how to pre-empt a process? I was given an answer to how pre-emption occurs.
Now I am wondering, how does the kernel scheduler know that a timeslice has passed? I read up on the hardware timer solution which makes sense to me, but then I read that most current operating systems (e.g. Windows, Linux, etc.) do not use hardware timers, but rather software timers.
How can software timers be used to pre-empt a process once it has taken up its timeslice (e.g. it did not pre-empt itself.) It seems like some hardware timer would be necessary?
man 7 time
- systutorials.com/docs/linux/man/7-time.