Max-Hailperin/Operating-Systems-and-Middleware--Supporting-Controlled-Interaction — Issue #13: preemptive multitasking needs clarification
Author: Max-Hailperin
Created: 2012-01-12 22:52:18+00:00
State: open

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