I have some questions about scheduling/multitasking in computer operating systems. If the details are platform-specific, I'm talking about Linux running on x86.
I understand that the scheduler is the component of the operating system that distributes threads of execution to physical processing cores (assuming no hyperthreading.) My question is, How does the scheduler tell a core to stop executing code from wherever in memory it currently is, and start executing code from a different point in memory? It seems like some kind of interrupt that the scheduler sends to the processing core, but AFAIK interupts eventually return to the original thread of execution. (as in they "interrupt" the conversation, not change the subject.)
I would read the Linux scheduler code but my understanding of C isn't that great.