-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: remove signal_fn in executor. #430
Conversation
I think it's reasonable with the extra constraint and workaround until there is an actual use case for having different signal_fns for different executors. |
One disadvantage of only using InterruptExecutor is you're no longer running anything in thread mode, so ThreadModeMutex becomes useless. We could have ThreadModeMutex-equivalents for interrupts. The downside is "Check current prio equals X" is a bit slower (you have to get the current irqn from IPSR, then look up its prio in NVIC.IPRx). "Check current irqn is X" is unsound because you can change the prio for that irq. |
Hi, I'm not sure where to write this but I wanted your input on the use of the sev() instruction as the signal_fn in the thread mode executor. For context I am trying to get a quick port of Embassy working on a RISCV ESP32C3 board
However, suppose that after polling new tasks in the runqueue, the executor schedules a new alarm for a timestamp that has already passed. Depending on how the time driver is implemented, this would
or
Since I don't own any cortex_m board, I am unable to test if this is generally an issue for existing boards or if it is mentioned somewhere as the limitation of the thread mode executor. Sorry if I'm being stupid! |
WFE/SEV work like this:
So it's OK if the I don't know if there's an equivalent in RISCV, If not, it could be done with a global BTW you might want to get in touch with @MabezDev and the other foks from Espressif, they're also interested in this, see #745 . Also, come join the chat! :D |
Probably not gonna happen anytime soon. |
The dynamic call into signal_fn here is rather slow (20-30 cycles). It would be cool to get rid of it.
However, it is needed to allow having multiple executors with different signal_fn's at the same time. For example, one WFE executor and one interrupt executor. It is not possible to use generics instead, as they would have to infect Executor, TaskStorage, TaskHeader, and we would still need a dynamic call when waking because now there can be multiple TaskHeader types. Not cool.
Solution: drop the possibility of mixing WFE and interrupt executors. This is not that big of a downside: if you want just one executor, use WFE. If you want multiple, just use all interrupt executors. YOu'll need to use up one extra hardware priority level, but these are usually plentiful.
(possibility of mixing could be added back by having ExecutorWaker store which kind it is and do an
if
. Not zero cost but probably still faster than a dyn call)TODO fix stm32, rp.
TODO add cargo features.