Disabling Ints in Switching
Posted: Mon Jan 16, 2006 2:36 pm
Hi
Why must i disable interrupts when i'm switching tasks ?
Since i defined a global pointer for current task which i always use to switch context in all interrupts, if i want to switch process i just change that pointer, if i don't i just keep it like this BUT i always switch tasks in all interrupts.
So, if the pointer is unchanged the task switches to itself.
I think this is wasting of cpu time , is there is a better approch ?
Since i do context switching in all interrupts so disable interrupts in the begging of each ISR the enable it before IRET.
So does that prevent nested interrupts or any other feature ?
However, in my tests i found that disabling & re-enabling interrupts during context switching doesn't make sense, does any one agree with me ?
Why must i disable interrupts when i'm switching tasks ?
Since i defined a global pointer for current task which i always use to switch context in all interrupts, if i want to switch process i just change that pointer, if i don't i just keep it like this BUT i always switch tasks in all interrupts.
So, if the pointer is unchanged the task switches to itself.
I think this is wasting of cpu time , is there is a better approch ?
Since i do context switching in all interrupts so disable interrupts in the begging of each ISR the enable it before IRET.
So does that prevent nested interrupts or any other feature ?
However, in my tests i found that disabling & re-enabling interrupts during context switching doesn't make sense, does any one agree with me ?