How is context switch made in linux kernel when process exits before timer interrupt?
I know that if the process is running and timer interrupt occurs then
schedule function is called automatically if the flag is set, schedule function then selects next process to run. Basically in this case the schedule function runs in the context of current process but what happens when process exits even before timer interrupt? who calls
schedule function in this case? And in what context does it run?
Note: I had asked this question originally on stackoverflow but I am asking it here again as there was no response on stackoverflow.