Force context switch on other core

pentagolo
Posts: 2
Joined: Wed Mar 06, 2019 6:08 am

Force context switch on other core

Postby pentagolo » 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

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: Force context switch on other core

Postby ESP_Sprite » Fri Mar 08, 2019 9:16 am

I'm afraid your understanding is incorrect. If an action on one core unblocks a task on the other core, and the unblocked task has a higher priority than the task that currently runs at that core, we force a call into the scheduler to have the other core switch to the newly unblocked task immediately. If that's not what you're seeing, there's a bug somewhere.

Who is online

Users browsing this forum: No registered users and 159 guests