Machine-translated by Google. Questions are authored in English.
Top

Discussion

A context switch consists of

  • A.saving one task's registers and stack pointer and restoring another's
  • B.copying one task's code out of flash and another's in
  • C.reloading the interrupt vector table for the incoming task
  • D.erasing the outgoing task's stack before the next task is allowed to run at all

Answer: A

Only the volatile state has to move, and how much that is depends on the core: a part with a floating point unit has far more to save. The switch is pure overhead, which is why its cost is quoted in cycles and why very frequent switching is wasteful.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.