GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
This is excerpted from email from Ryan McFall, who pointed out that it isn't clear "how having the interrupt handler save/restore registers restores into the right thread context....
I would suggest moving the Linux Kernel code example after the part about preemptive multitasking, instead of after the non-preemptive part. Since I know that Linux uses preemptive multitasking (and I'd expect students would), I got confused at the point when I was reading the example, and didn't relate the part that came after the example back to Linux.
I also think making the connection between the interrupt handler and switch_to explicit in the text would be helpful. In particular, discussing how the interrupt handler's saving of the registers (which will be associated with the "from" thread), calling of switch_to, and then restoring the registers (which will now come from the "to" thread's stack because the stack pointer has been changed in switch_to) works to correctly save/restore the correct thread context would have been helpful to me.
If you revise the text and want me to look over it to see if it makes more sense to me, I am certainly willing to do that."