preemptive multitasking needs clarification #13

Closed
Max-Hailperin opened this Issue Jan 12, 2012 · 0 comments

Comments

Projects
None yet
1 participant
Owner

Max-Hailperin commented Jan 12, 2012

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment