There are two cases where the scheduler code schedule()
is invoked-
When a process voluntarily calls
schedule()
Timer interrupt calls
schedule()
In case 2, I think schedule()
runs in interrupt context, but what about the first case? Does it run in the context of the process which invoked it?
Also are there any more scenarios which invoke schedule()
?