Why are only some of the registers stored when making a context switch. #561
-
|
Why are only some of the registers stored when making a context switch? Is it possible to switch tasks in and out of different cpu cores using the example taskswicth();??? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
The scheduler in Circle is cooperative and task switches can only happen, when a C or C++ function gets called. That's why The Circle scheduler and its tasks always run on core 0. The other cores are free for other things. So normally no, you cannot run tasks on core 1-3. |
Beta Was this translation helpful? Give feedback.
I extended the scheduler earlier, so that it was running on all available cores. But it was not possible to move a task from one to another core in this setup. I did not completed this, because it added a lot of complexity, but was not really useful.
For a cooperative scheduler I think it's not necessary to save more registers. For a preemptive scheduler it would be, but Circle is not really prepared for this. Most functions are not re-entrant.