Force context switch on other core
Posted: Wed Mar 06, 2019 8:07 am
Hi,
i need to switch to a higher priority task on one core when it is unblocked by the other core as soon as possible.
As far as i understand, unblocking a higher priority task (pinned to PRO core) from the APP core, will result in a context switch on PRO core only when some other API functions are called from there. But if PRO core executes the idle task, the context switch on PRO core will only occur after the next tick interrupt.
What is the preferred way to initiate an interrupt by software, which is executed on the other core and just checks for higher priority tasks woken?
Is there some build in functionality i could use?
Should i implement this by using the pin changed interrupt of an unused pin or is there a better suited interrupt source?
Is there a hook i could use to trigger the interrupt whenever the task is marked ready?
What would be the best mechanism to reduce the risk of unnecessary executing of the interrupt (when the higher priority task is already running)? Is there hook in the tick interrupt or scheduler which i could use to temporary disable the interrupt? When should i enable it again?
Background:
I need to process data read in from an external ADC (16MB/s). New data has to be processed each 300us. In order to reduce the required buffer size and satisfy my timing constraints, i have to process this data on both cores as soon as possible.
Thanks
i need to switch to a higher priority task on one core when it is unblocked by the other core as soon as possible.
As far as i understand, unblocking a higher priority task (pinned to PRO core) from the APP core, will result in a context switch on PRO core only when some other API functions are called from there. But if PRO core executes the idle task, the context switch on PRO core will only occur after the next tick interrupt.
What is the preferred way to initiate an interrupt by software, which is executed on the other core and just checks for higher priority tasks woken?
Is there some build in functionality i could use?
Should i implement this by using the pin changed interrupt of an unused pin or is there a better suited interrupt source?
Is there a hook i could use to trigger the interrupt whenever the task is marked ready?
What would be the best mechanism to reduce the risk of unnecessary executing of the interrupt (when the higher priority task is already running)? Is there hook in the tick interrupt or scheduler which i could use to temporary disable the interrupt? When should i enable it again?
Background:
I need to process data read in from an external ADC (16MB/s). New data has to be processed each 300us. In order to reduce the required buffer size and satisfy my timing constraints, i have to process this data on both cores as soon as possible.
Thanks