In RTOS, when a Higher Priority task becomes Ready to Run, it stops or preempts currently running (Lower Priority) task and start executing itself. Before switching tasks, RTOS saves required data related to lower priority task (Context Switching)
Coming to my question, Like tasks, Interrupts also have priorities. When a Lower priority interrupt is executing and a Higher priority interrupt comes, What happens? Does it stores all data on Stack etc. just like RTOS? What will happen to my variables used in ISR?
(Note that, this scenario is possible in a Non-RTOS based application too!)